]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPlatformPkg/Bds: Use HandleProtocol to get SNP instance
authorHeyi Guo <heyi.guo@linaro.org>
Thu, 16 Jul 2015 11:27:05 +0000 (11:27 +0000)
committeroliviermartin <oliviermartin@Edk2>
Thu, 16 Jul 2015 11:27:05 +0000 (11:27 +0000)
LocateProtocol only gets the 1st SNP instance and this will be wrong
in a system with multiple SNP instances installed. Use HandleProtocol
instead.

Cc: Olivier Martin <olivier.martin@arm.com>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Heyi Guo <heyi.guo@linaro.org>
Reviewed-by: Olivier Martin <Olivier.Martin@arm.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18030 6f19259b-4bc3-4df7-8a09-765794883524

ArmPlatformPkg/Bds/BootOptionSupport.c

index f50f13f71dd23f0dc428d9aeed8ec4fdc193c6ec..27faf003c69e3999eb2de814844e8ab41da4321d 100644 (file)
@@ -667,7 +667,7 @@ BdsLoadOptionPxeList (
       // Allocate BDS Supported Device structure\r
       SupportedDevice = (BDS_SUPPORTED_DEVICE*)AllocatePool(sizeof(BDS_SUPPORTED_DEVICE));\r
 \r
-      Status = gBS->LocateProtocol (&gEfiSimpleNetworkProtocolGuid, NULL, (VOID **)&SimpleNet);\r
+      Status = gBS->HandleProtocol (HandleBuffer[Index], &gEfiSimpleNetworkProtocolGuid, (VOID **)&SimpleNet);\r
       if (!EFI_ERROR(Status)) {\r
         Mac = &SimpleNet->Mode->CurrentAddress;\r
         UnicodeSPrint (DeviceDescription,BOOT_DEVICE_DESCRIPTION_MAX,L"MAC Address: %02x:%02x:%02x:%02x:%02x:%02x", Mac->Addr[0],  Mac->Addr[1],  Mac->Addr[2],  Mac->Addr[3],  Mac->Addr[4],  Mac->Addr[5]);\r