From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.88; helo=mga01.intel.com; envelope-from=hao.a.wu@intel.com; receiver=edk2-devel@lists.01.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 1B693211E2BF4 for ; Wed, 20 Mar 2019 18:13:23 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Mar 2019 18:13:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,250,1549958400"; d="scan'208";a="216044743" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga001.jf.intel.com with ESMTP; 20 Mar 2019 18:13:16 -0700 Received: from fmsmsx158.amr.corp.intel.com (10.18.116.75) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 20 Mar 2019 18:12:40 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx158.amr.corp.intel.com (10.18.116.75) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 20 Mar 2019 18:12:39 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.74]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.26]) with mapi id 14.03.0415.000; Thu, 21 Mar 2019 09:12:37 +0800 From: "Wu, Hao A" To: Leif Lindholm , Ming Huang CC: "linaro-uefi@lists.linaro.org" , "edk2-devel@lists.01.org" , "Kinney, Michael D" , "Gao, Liming" , "ard.biesheuvel@linaro.org" , "wanghuiqiang@huawei.com" , "huangming23@huawei.com" , "zhangjinsong2@huawei.com" , "mengfanrong@huawei.com" , "huangdaode@hisilicon.com" Thread-Topic: [Patch MdeModulePkg/Library v1 1/1] MdeModulePkg/UefiBootManangerLib: Fix exception issue Thread-Index: AQHU3lo90d3UQRyjrUipGppolcIB2KYVSSzA Date: Thu, 21 Mar 2019 01:12:36 +0000 Message-ID: References: <20190319125913.19187-1-ming.huang@linaro.org> <20190319125913.19187-2-ming.huang@linaro.org> <20190319134650.vlohpalhrm7ldaqf@bivouac.eciton.net> In-Reply-To: <20190319134650.vlohpalhrm7ldaqf@bivouac.eciton.net> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [Patch MdeModulePkg/Library v1 1/1] MdeModulePkg/UefiBootManangerLib: Fix exception issue X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Mar 2019 01:13:24 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Thanks Ming and Leif. Reviewed-by: Hao Wu Patch was committed at 6c27a4d337d0034cecf9f2c05d1f20c342d41e01. Best Regards, Hao Wu > -----Original Message----- > From: Leif Lindholm [mailto:leif.lindholm@linaro.org] > Sent: Tuesday, March 19, 2019 9:47 PM > To: Ming Huang > Cc: linaro-uefi@lists.linaro.org; edk2-devel@lists.01.org; Wu, Hao A; Kin= ney, > Michael D; Gao, Liming; ard.biesheuvel@linaro.org; > wanghuiqiang@huawei.com; huangming23@huawei.com; > zhangjinsong2@huawei.com; mengfanrong@huawei.com; > huangdaode@hisilicon.com > Subject: Re: [Patch MdeModulePkg/Library v1 1/1] > MdeModulePkg/UefiBootManangerLib: Fix exception issue >=20 > Thanks, Ming. >=20 > On Tue, Mar 19, 2019 at 08:59:13PM +0800, Ming Huang wrote: > > The system environment: virtual-CDROM(USB interface) via BMC, insert a > > iso file to CDROM, like ubuntu-18.04.1-server-arm64.iso, change CDROM > > to first boot option. > > With release version bios, disconnecting CDROM when boot to > > "1 seconds left, Press Esc or F2 to enter Setup" > > then system will get a exception. > > > > The root cause is the EFI_BLOCK_IO_PROTOCOL for UsbMass will be > uninstalled > > in this situation after print some transfer error. The status will be > > invalid parameter. This line will get a exception for BlockIo not point > > to right address: > > AllocatePool (BlockIo->Media->BlockSize) > > So, here need to judge the status after ASSERT_EFI_ERROR. > > > > The Bugzilla tracker for this: > > https://bugzilla.tianocore.org/show_bug.cgi?id=3D1631 > > > > Contributed-under: TianoCore Contribution Agreement 1.1 > > Signed-off-by: Ming Huang >=20 > Reviewed-by: Leif Lindholm >=20 > > --- > > MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c | 3 +++ > > 1 file changed, 3 insertions(+) > > > > diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c > b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c > > index 4ce83ce22d61..0535cd7335b4 100644 > > --- a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c > > +++ b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c > > @@ -1069,6 +1069,9 @@ BmExpandMediaDevicePath ( > > // > > Status =3D gBS->HandleProtocol (Handle, &gEfiBlockIoProtocolGuid, (V= OID > **) &BlockIo); > > ASSERT_EFI_ERROR (Status); > > + if (EFI_ERROR (Status)) { > > + return NULL; > > + } > > Buffer =3D AllocatePool (BlockIo->Media->BlockSize); > > if (Buffer !=3D NULL) { > > BlockIo->ReadBlocks ( > > -- > > 2.9.5 > >