From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.126, mailfrom: ray.ni@intel.com) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by groups.io with SMTP; Mon, 03 Jun 2019 00:26:57 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Jun 2019 00:26:56 -0700 X-ExtLoop1: 1 Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga004.fm.intel.com with ESMTP; 03 Jun 2019 00:26:56 -0700 Received: from fmsmsx116.amr.corp.intel.com (10.18.116.20) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 3 Jun 2019 00:26:55 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by fmsmsx116.amr.corp.intel.com (10.18.116.20) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 3 Jun 2019 00:26:55 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.137]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.10]) with mapi id 14.03.0415.000; Mon, 3 Jun 2019 15:26:53 +0800 From: "Ni, Ray" 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 Thread-Topic: [PATCH 2/2] MdeModulePkg/BdsDxe: Use a pcd to control PlatformRecovery Thread-Index: AQHVGde/TaOcdBKQvEyVN6fg8pKL86aJfjSAgAADjPCAAAScAA== Date: Mon, 3 Jun 2019 07:26:52 +0000 Message-ID: <734D49CCEBEEF84792F5B80ED585239D5C18AEB9@SHSMSX104.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> <3CE959C139B4C44DBEA1810E3AA6F9000B7E322A@SHSMSX101.ccr.corp.intel.com> In-Reply-To: <3CE959C139B4C44DBEA1810E3AA6F9000B7E322A@SHSMSX101.ccr.corp.intel.com> Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: ray.ni@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable > -----Original Message----- > From: Gao, Zhichao > Sent: Monday, June 3, 2019 3:13 PM > 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 >=20 >=20 >=20 > > -----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 > > > > > + // > > > + // When platform recovery is not enabled, still boot to > > > + platform default > > > file path. > > > + // > > > + EfiBootManagerProcessLoadOption (&PlatformDefaultBootOption); > > > + } > > > } > > > + EfiBootManagerFreeLoadOption (&PlatformDefaultBootOption); > > > > PlatformDefaultBootOption might be uninitialized if FilePath is NULL. >=20 > EfiBootManagerFreeLoadOption would check the pointer before free. So it i= s > 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(). >=20 > Maybe it is not enough. The ASSERT only work in DEBUG build. Did I take a > mistake? You are right. How about do a DEBUG print followed by a CpuDeadLoop() when FilePath is NUL= L? Then all code below that point doesn't need to take care this error any mor= e. >=20 > Thanks, > Zhichao >=20 > > > > > > > > > > > > DEBUG ((EFI_D_ERROR, "[Bds] Unable to boot!\n")); > > > PlatformBootManagerUnableToBoot (); > > > -- > > > 2.21.0.windows.1