Browse Source

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 <Dimitrije.Pavlov@arm.com>
Reviewed-by: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>
Reviewed-by: Sunny Wang <sunny.wang@arm.com>
Dimitrije Pavlov 1 year ago
parent
commit
f80580f56b
1 changed files with 7 additions and 0 deletions
  1. 7 0
      OvmfPkg/VirtioNetDxe/ComponentName.c

+ 7 - 0
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