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

Dimitrije Pavlov Dimitrije.Pavlov at arm.com
Wed Aug 17 14:35:03 UTC 2022


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



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#92518): https://edk2.groups.io/g/devel/message/92518
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