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>
This commit is contained in:
Dimitrije Pavlov 2022-08-17 09:35:03 -05:00 committed by mergify[bot]
parent 8db4e9f9a0
commit f80580f56b
1 changed files with 7 additions and 0 deletions

View File

@ -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