diff options
author | Dimitrije Pavlov <dimitrije.pavlov@arm.com> | 2022-08-17 09:35:03 -0500 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2022-10-10 10:17:11 +0000 |
commit | f80580f56b267c96f16f985dbf707b2f96947da4 (patch) | |
tree | 821c675b37f38d93de9c8347ea1f61eb8b7319e3 /OvmfPkg/VirtioNetDxe | |
parent | 8db4e9f9a0c2ec992e28259ceb7a8eb316716b05 (diff) | |
download | edk2-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/VirtioNetDxe')
-rw-r--r-- | OvmfPkg/VirtioNetDxe/ComponentName.c | 7 |
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
//
|