From f80580f56b267c96f16f985dbf707b2f96947da4 Mon Sep 17 00:00:00 2001 From: Dimitrije Pavlov Date: Wed, 17 Aug 2022 09:35:03 -0500 Subject: 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. Signed-off-by: Dimitrije Pavlov Reviewed-by: Samer El-Haj-Mahmoud Reviewed-by: Sunny Wang --- OvmfPkg/VirtioNetDxe/ComponentName.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'OvmfPkg/VirtioNetDxe') diff --git a/OvmfPkg/VirtioNetDxe/ComponentName.c b/OvmfPkg/VirtioNetDxe/ComponentName.c index e340ca2f8f..718096630f 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 -- cgit v1.2.3