From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.43, mailfrom: zhichao.gao@intel.com) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by groups.io with SMTP; Mon, 03 Jun 2019 00:13:18 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Jun 2019 00:13:18 -0700 X-ExtLoop1: 1 Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga008.fm.intel.com with ESMTP; 03 Jun 2019 00:13:18 -0700 Received: from shsmsx106.ccr.corp.intel.com (10.239.4.159) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 3 Jun 2019 00:13:18 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.10]) by SHSMSX106.ccr.corp.intel.com ([169.254.10.113]) with mapi id 14.03.0415.000; Mon, 3 Jun 2019 15:13:16 +0800 From: "Gao, Zhichao" To: "Ni, Ray" , "devel@edk2.groups.io" CC: "Wang, Jian J" , "Wu, Hao A" , "Zeng, Star" , "Gao, Liming" , Sean Brogan , Michael Turner , Bret Barkelew Subject: Re: [PATCH 2/2] MdeModulePkg/BdsDxe: Use a pcd to control PlatformRecovery Thread-Topic: [PATCH 2/2] MdeModulePkg/BdsDxe: Use a pcd to control PlatformRecovery Thread-Index: AQHVGde/TaOcdBKQvEyVN6fg8pKL86aJfjSAgAADjPA= Date: Mon, 3 Jun 2019 07:13:16 +0000 Message-ID: <3CE959C139B4C44DBEA1810E3AA6F9000B7E322A@SHSMSX101.ccr.corp.intel.com> References: <20190603064358.13296-1-zhichao.gao@intel.com> <20190603064358.13296-3-zhichao.gao@intel.com> <734D49CCEBEEF84792F5B80ED585239D5C18AD13@SHSMSX104.ccr.corp.intel.com> In-Reply-To: <734D49CCEBEEF84792F5B80ED585239D5C18AD13@SHSMSX104.ccr.corp.intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: zhichao.gao@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable > -----Original Message----- > From: Ni, Ray > Sent: Monday, June 3, 2019 2:59 PM > To: Gao, Zhichao ; devel@edk2.groups.io > Cc: Wang, Jian J ; Wu, Hao A ; > Zeng, Star ; Gao, Liming ; > Sean Brogan ; Michael Turner > ; Bret Barkelew > > Subject: RE: [PATCH 2/2] MdeModulePkg/BdsDxe: Use a pcd to control > PlatformRecovery >=20 > > + // > > + // When platform recovery is not enabled, still boot to > > + platform default > > file path. > > + // > > + EfiBootManagerProcessLoadOption (&PlatformDefaultBootOption); > > + } > > } > > + EfiBootManagerFreeLoadOption (&PlatformDefaultBootOption); >=20 > PlatformDefaultBootOption might be uninitialized if FilePath is NULL. EfiBootManagerFreeLoadOption would check the pointer before free. So it is = safe regardless of the PlatformDefaultBootOption is initialized or not. >=20 > FilePath is NULL when memory allocation fails. > So I am thinking maybe ASSERT (FilePath !=3D NULL) is enough when > EfiBootManagerInitializeLoadOption(). Maybe it is not enough. The ASSERT only work in DEBUG build. Did I take a m= istake? Thanks, Zhichao >=20 >=20 >=20 > > > > DEBUG ((EFI_D_ERROR, "[Bds] Unable to boot!\n")); > > PlatformBootManagerUnableToBoot (); > > -- > > 2.21.0.windows.1