Looks good. Reviewed-by: Sunny Wang <sunny.w...@arm.com> -----Original Message----- From: Dimitrije Pavlov <dimitrije.pav...@arm.com> Sent: 17 August 2022 15:35 To: devel@edk2.groups.io Cc: Ard Biesheuvel <ardb+tianoc...@kernel.org>; Jiewen Yao <jiewen....@intel.com>; Liming Gao <gaolim...@byosoft.com.cn>; Sunny Wang <sunny.w...@arm.com>; Jeff Booher-Kaeding <jeff.booher-kaed...@arm.com>; Samer El-Haj-Mahmoud <samer.el-haj-mahm...@arm.com> Subject: [PATCH v1 1/1] 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. Cc: Ard Biesheuvel <ardb+tianoc...@kernel.org> Cc: Jiewen Yao <jiewen....@intel.com> Cc: Liming Gao <gaolim...@byosoft.com.cn> Cc: Sunny Wang <sunny.w...@arm.com> Cc: Jeff Booher-Kaeding <jeff.booher-kaed...@arm.com> Cc: Samer El-Haj-Mahmoud <samer.el-haj-mahm...@arm.com> Signed-off-by: Dimitrije Pavlov <dimitrije.pav...@arm.com> --- OvmfPkg/VirtioNetDxe/ComponentName.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/OvmfPkg/VirtioNetDxe/ComponentName.c b/OvmfPkg/VirtioNetDxe/ComponentName.c index e340ca2f8fe4..718096630f6f 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 -- 2.37.2 IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you. -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#92580): https://edk2.groups.io/g/devel/message/92580 Mute This Topic: https://groups.io/mt/93082232/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-