[edk2-devel] [PATCH v1 1/1] OvmfPkg/VirtioNetDxe: Check ChildHandle argument in GetControllerName

Sunny Wang Sunny.Wang at arm.com
Fri Aug 19 14:46:58 UTC 2022


Looks good.
Reviewed-by: Sunny Wang <sunny.wang at arm.com>

-----Original Message-----
From: Dimitrije Pavlov <dimitrije.pavlov at arm.com>
Sent: 17 August 2022 15:35
To: devel at edk2.groups.io
Cc: Ard Biesheuvel <ardb+tianocore at kernel.org>; Jiewen Yao <jiewen.yao at intel.com>; Liming Gao <gaoliming at byosoft.com.cn>; Sunny Wang <Sunny.Wang at arm.com>; Jeff Booher-Kaeding <Jeff.Booher-Kaeding at arm.com>; Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud at arm.com>
Subject: [PATCH v1 1/1] OvmfPkg/VirtioNetDxe: Check ChildHandle argument in GetControllerName

Per the UEFI specification, a device driver implementation should return
EFI_UNSUPPORTED if the ChildHandle argument in
EFI_COMPONENT_NAME2_PROTOCOL.GetControllerName() is not NULL.

Cc: Ard Biesheuvel <ardb+tianocore at kernel.org>
Cc: Jiewen Yao <jiewen.yao at intel.com>
Cc: Liming Gao <gaoliming at byosoft.com.cn>
Cc: Sunny Wang <Sunny.Wang at arm.com>
Cc: Jeff Booher-Kaeding <Jeff.Booher-Kaeding at arm.com>
Cc: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud at arm.com>

Signed-off-by: Dimitrije Pavlov <Dimitrije.Pavlov at arm.com>
---
 OvmfPkg/VirtioNetDxe/ComponentName.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/OvmfPkg/VirtioNetDxe/ComponentName.c b/OvmfPkg/VirtioNetDxe/ComponentName.c
index e340ca2f8fe4..718096630f6f 100644
--- a/OvmfPkg/VirtioNetDxe/ComponentName.c
+++ b/OvmfPkg/VirtioNetDxe/ComponentName.c
@@ -129,6 +129,13 @@ VirtioNetGetControllerName (
     return EFI_INVALID_PARAMETER;
   }

+  //
+  // This is a device driver, so ChildHandle must be NULL.
+  //
+  if (ChildHandle != NULL) {
+    return EFI_UNSUPPORTED;
+  }
+
   //
   // confirm that the device is managed by this driver, using the VirtIo
   // Protocol
--
2.37.2

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#92580): https://edk2.groups.io/g/devel/message/92580
Mute This Topic: https://groups.io/mt/93082232/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-




More information about the edk2-devel-archive mailing list