summaryrefslogtreecommitdiffstats
path: root/OvmfPkg
diff options
context:
space:
mode:
authorDimitrije Pavlov <dimitrije.pavlov@arm.com>2022-08-17 09:35:03 -0500
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2022-10-10 10:17:11 +0000
commitf80580f56b267c96f16f985dbf707b2f96947da4 (patch)
tree821c675b37f38d93de9c8347ea1f61eb8b7319e3 /OvmfPkg
parent8db4e9f9a0c2ec992e28259ceb7a8eb316716b05 (diff)
downloadedk2-f80580f56b267c96f16f985dbf707b2f96947da4.tar.gz
edk2-f80580f56b267c96f16f985dbf707b2f96947da4.tar.bz2
edk2-f80580f56b267c96f16f985dbf707b2f96947da4.zip
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>
Diffstat (limited to 'OvmfPkg')
-rw-r--r--OvmfPkg/VirtioNetDxe/ComponentName.c7
1 files changed, 7 insertions, 0 deletions
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
@@ -130,6 +130,13 @@ VirtioNetGetControllerName (
}
//
+ // 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
//