public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH v1 1/1] OvmfPkg/VirtioNetDxe: Check ChildHandle argument in GetControllerName
@ 2022-08-17 14:35 Dimitrije Pavlov
  2022-08-17 20:44 ` Samer El-Haj-Mahmoud
  2022-08-19 14:46 ` Sunny Wang
  0 siblings, 2 replies; 5+ messages in thread
From: Dimitrije Pavlov @ 2022-08-17 14:35 UTC (permalink / raw)
  To: devel
  Cc: Ard Biesheuvel, Jiewen Yao, Liming Gao, Sunny Wang,
	Jeff Booher-Kaeding, Samer El-Haj-Mahmoud

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@kernel.org>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Sunny Wang <Sunny.Wang@arm.com>
Cc: Jeff Booher-Kaeding <Jeff.Booher-Kaeding@arm.com>
Cc: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>

Signed-off-by: Dimitrije Pavlov <Dimitrije.Pavlov@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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-10-10 10:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-17 14:35 [PATCH v1 1/1] OvmfPkg/VirtioNetDxe: Check ChildHandle argument in GetControllerName Dimitrije Pavlov
2022-08-17 20:44 ` Samer El-Haj-Mahmoud
2022-08-19 14:46 ` Sunny Wang
2022-09-28 13:32   ` Samer El-Haj-Mahmoud
2022-10-10 10:18     ` [edk2-devel] " Ard Biesheuvel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox