From patchwork Thu Jul 16 08:35:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: gary guo X-Patchwork-Id: 51144 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id F321D22A8A for ; Thu, 16 Jul 2015 08:36:05 +0000 (UTC) Received: by laef2 with SMTP id f2sf16896217lae.0 for ; Thu, 16 Jul 2015 01:36:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:subject :precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:errors-to:x-original-sender :x-original-authentication-results:mailing-list; bh=HpNpfuOm7oxQC0MtSaMfo3ykKbg3+rB465IeT+zLUDA=; b=MJ2F6/52FLz5VLLqRfkS0YUCCeIdZFgMJhTXIArbvE51iIKS010VP5pWiAMSknEmiH KdtjvsB9hqxBEJKV31ZPXAq49nKZ3qFCe3qfU3H/p5kmO6jCNzqjBZu+X21FDbtdmC6P uziOhJvQcbHTnqxGrJgETuZGL2tWPLrQhuJc3mddBFbthTd5lt0zEq9NfPnVA5OhYZk0 1g5CyAHaBlhpe8CQAy5BNTzd9EtArA1lBYMj2vM4OTvd0HnutIEjYGBRhlM0MTlzxFqA glLP9aCcGTG79QvbTUuaSPiVJyAsAZfGez/DdlzQp+NOLmyizNSRZOeTe3Yd4sx9kTS7 5kSA== X-Gm-Message-State: ALoCoQk1A4pLNQtI07LvJ6T6cbBQNkDgOKpBDYouOME4LYanLjctHHEFCvmag76JyS5vFqg+IFNX X-Received: by 10.180.97.9 with SMTP id dw9mr1322485wib.2.1437035764854; Thu, 16 Jul 2015 01:36:04 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.179.171 with SMTP id dh11ls286100lac.47.gmail; Thu, 16 Jul 2015 01:36:04 -0700 (PDT) X-Received: by 10.152.37.37 with SMTP id v5mr8099629laj.11.1437035764687; Thu, 16 Jul 2015 01:36:04 -0700 (PDT) Received: from mail-la0-f53.google.com (mail-la0-f53.google.com. [209.85.215.53]) by mx.google.com with ESMTPS id t2si6308602lbj.163.2015.07.16.01.36.04 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 Jul 2015 01:36:04 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) client-ip=209.85.215.53; Received: by lagx9 with SMTP id x9so39189681lag.1 for ; Thu, 16 Jul 2015 01:36:04 -0700 (PDT) X-Received: by 10.152.206.75 with SMTP id lm11mr8044177lac.41.1437035764528; Thu, 16 Jul 2015 01:36:04 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp99722lbb; Thu, 16 Jul 2015 01:36:03 -0700 (PDT) X-Received: by 10.107.163.16 with SMTP id m16mr9188861ioe.31.1437035763110; Thu, 16 Jul 2015 01:36:03 -0700 (PDT) Received: from lists.sourceforge.net (lists.sourceforge.net. [216.34.181.88]) by mx.google.com with ESMTPS id y1si6431114icv.44.2015.07.16.01.36.02 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 16 Jul 2015 01:36:03 -0700 (PDT) Received-SPF: pass (google.com: domain of edk2-devel-bounces@lists.sourceforge.net designates 216.34.181.88 as permitted sender) client-ip=216.34.181.88; Received: from localhost ([127.0.0.1] helo=sfs-ml-3.v29.ch3.sourceforge.com) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1ZFee1-0007sP-0H; Thu, 16 Jul 2015 08:35:53 +0000 Received: from sog-mx-1.v43.ch3.sourceforge.com ([172.29.43.191] helo=mx.sourceforge.net) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1ZFedz-0007sI-3y for edk2-devel@lists.sourceforge.net; Thu, 16 Jul 2015 08:35:51 +0000 Received-SPF: pass (sog-mx-1.v43.ch3.sourceforge.com: domain of linaro.org designates 209.85.192.173 as permitted sender) client-ip=209.85.192.173; envelope-from=heyi.guo@linaro.org; helo=mail-pd0-f173.google.com; Received: from mail-pd0-f173.google.com ([209.85.192.173]) by sog-mx-1.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1ZFedx-0003aH-9k for edk2-devel@lists.sourceforge.net; Thu, 16 Jul 2015 08:35:51 +0000 Received: by pdrg1 with SMTP id g1so40504761pdr.2 for ; Thu, 16 Jul 2015 01:35:43 -0700 (PDT) X-Received: by 10.70.42.166 with SMTP id p6mr5962883pdl.118.1437035743627; Thu, 16 Jul 2015 01:35:43 -0700 (PDT) Received: from localhost.localdomain ([180.150.157.4]) by smtp.gmail.com with ESMTPSA id nv2sm7110935pdb.25.2015.07.16.01.35.41 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 16 Jul 2015 01:35:43 -0700 (PDT) From: Heyi Guo To: edk2-devel@lists.sourceforge.net Date: Thu, 16 Jul 2015 16:35:17 +0800 Message-Id: <1437035717-24472-1-git-send-email-heyi.guo@linaro.org> X-Mailer: git-send-email 2.1.4 X-Spam-Score: -1.5 (-) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain -0.0 SPF_PASS SPF: sender matches SPF record -0.0 AWL AWL: Adjusted score from AWL reputation of From: address X-Headers-End: 1ZFedx-0003aH-9k Subject: [edk2] [PATCH] ArmPlatformPkg/Bds: Use HandleProtocol to get SNP instance X-BeenThere: edk2-devel@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.sourceforge.net X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: heyi.guo@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 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 Cc: Leif Lindholm Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Heyi Guo --- ArmPlatformPkg/Bds/BootOptionSupport.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ArmPlatformPkg/Bds/BootOptionSupport.c b/ArmPlatformPkg/Bds/BootOptionSupport.c index f50f13f..27faf00 100644 --- a/ArmPlatformPkg/Bds/BootOptionSupport.c +++ b/ArmPlatformPkg/Bds/BootOptionSupport.c @@ -667,7 +667,7 @@ BdsLoadOptionPxeList ( // Allocate BDS Supported Device structure SupportedDevice = (BDS_SUPPORTED_DEVICE*)AllocatePool(sizeof(BDS_SUPPORTED_DEVICE)); - Status = gBS->LocateProtocol (&gEfiSimpleNetworkProtocolGuid, NULL, (VOID **)&SimpleNet); + Status = gBS->HandleProtocol (HandleBuffer[Index], &gEfiSimpleNetworkProtocolGuid, (VOID **)&SimpleNet); if (!EFI_ERROR(Status)) { Mac = &SimpleNet->Mode->CurrentAddress; 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]);