From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mx.groups.io with SMTP id smtpd.web09.1120.1572418864528637579 for ; Wed, 30 Oct 2019 00:01:04 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.20, mailfrom: hao.a.wu@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Oct 2019 00:01:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,246,1569308400"; d="scan'208";a="351216648" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga004.jf.intel.com with ESMTP; 30 Oct 2019 00:01:03 -0700 Received: from FMSMSX110.amr.corp.intel.com (10.18.116.10) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 30 Oct 2019 00:01:03 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx110.amr.corp.intel.com (10.18.116.10) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 30 Oct 2019 00:01:03 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.127]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.2]) with mapi id 14.03.0439.000; Wed, 30 Oct 2019 15:01:01 +0800 From: "Wu, Hao A" To: "Zhang, Shenglei" , "devel@edk2.groups.io" CC: "Gao, Liming" Subject: Re: [PATCH 3/4] MdeModulePkg/EsrtDxe: Add check for EsrtRepository Thread-Topic: [PATCH 3/4] MdeModulePkg/EsrtDxe: Add check for EsrtRepository Thread-Index: AQHVhJtatm6Va96ItEetbDw8mon2Bqdy1jMw Date: Wed, 30 Oct 2019 07:01:00 +0000 Message-ID: References: <20191017033110.12128-1-shenglei.zhang@intel.com> <20191017033110.12128-4-shenglei.zhang@intel.com> In-Reply-To: <20191017033110.12128-4-shenglei.zhang@intel.com> 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 Return-Path: hao.a.wu@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable > -----Original Message----- > From: Zhang, Shenglei > Sent: Thursday, October 17, 2019 11:31 AM > To: devel@edk2.groups.io > Cc: Wu, Hao A; Gao, Liming > Subject: [PATCH 3/4] MdeModulePkg/EsrtDxe: Add check for EsrtRepository >=20 > EsrtRepository might be NULL. So return EFI_OUT_OF_RESOURCES > when it is NULL. >=20 > Cc: Hao A Wu > Cc: Liming Gao > Signed-off-by: Shenglei Zhang > --- > MdeModulePkg/Universal/EsrtDxe/EsrtImpl.c | 10 ++++++++++ > 1 file changed, 10 insertions(+) >=20 > diff --git a/MdeModulePkg/Universal/EsrtDxe/EsrtImpl.c > b/MdeModulePkg/Universal/EsrtDxe/EsrtImpl.c > index f48125382dbc..fff17b98fa3d 100644 > --- a/MdeModulePkg/Universal/EsrtDxe/EsrtImpl.c > +++ b/MdeModulePkg/Universal/EsrtDxe/EsrtImpl.c > @@ -239,6 +239,11 @@ DeleteEsrtEntry( > goto EXIT; > } >=20 > + if (EsrtRepository =3D=3D NULL) { > + Status =3D EFI_OUT_OF_RESOURCES; > + goto EXIT; > + } > + > if ((RepositorySize % sizeof(EFI_SYSTEM_RESOURCE_ENTRY)) !=3D 0) { > DEBUG((EFI_D_ERROR, "Repository Corrupt. Need to rebuild Repository.= \n")); > // > @@ -332,6 +337,11 @@ UpdateEsrtEntry( > &RepositorySize > ); >=20 > + if (EsrtRepository =3D=3D NULL) { > + Status =3D EFI_OUT_OF_RESOURCES; > + goto EXIT; > + } > + Reviewed-by: Hao A Wu Best Regards, Hao Wu > if (!EFI_ERROR(Status)) { > // > // if exist, update Esrt cache repository > -- > 2.18.0.windows.1