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 129F3220C163B for ; Wed, 22 Nov 2017 17:06:46 -0800 (PST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Nov 2017 17:11:03 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,438,1505804400"; d="scan'208";a="8470846" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga001.jf.intel.com with ESMTP; 22 Nov 2017 17:11:03 -0800 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 22 Nov 2017 17:11:02 -0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.152]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.213]) with mapi id 14.03.0319.002; Thu, 23 Nov 2017 09:11:01 +0800 From: "Wu, Hao A" To: "Zeng, Star" , "edk2-devel@lists.01.org" CC: "Yao, Jiewen" Thread-Topic: [PATCH] MdeModulePkg UhciPei: Also check TempPtr against NULL to return error Thread-Index: AQHTY/cE5hzHYrDLVEGS8qxD+g7TOKMhJ8Vw Date: Thu, 23 Nov 2017 01:10:59 +0000 Message-ID: References: <1511399045-9580-1-git-send-email-star.zeng@intel.com> In-Reply-To: <1511399045-9580-1-git-send-email-star.zeng@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 Subject: Re: [PATCH] MdeModulePkg UhciPei: Also check TempPtr against NULL to return error X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Nov 2017 01:06:47 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Hao Wu Best Regards, Hao Wu > -----Original Message----- > From: Zeng, Star > Sent: Thursday, November 23, 2017 9:04 AM > To: edk2-devel@lists.01.org > Cc: Zeng, Star; Wu, Hao A; Yao, Jiewen > Subject: [PATCH] MdeModulePkg UhciPei: Also check TempPtr against NULL > to return error >=20 > Cc: Hao Wu > Cc: Jiewen Yao > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Star Zeng > --- > MdeModulePkg/Bus/Pci/UhciPei/UhcPeim.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) >=20 > diff --git a/MdeModulePkg/Bus/Pci/UhciPei/UhcPeim.c > b/MdeModulePkg/Bus/Pci/UhciPei/UhcPeim.c > index b7d60db0c94e..482c404c0eae 100644 > --- a/MdeModulePkg/Bus/Pci/UhciPei/UhcPeim.c > +++ b/MdeModulePkg/Bus/Pci/UhciPei/UhcPeim.c > @@ -2863,8 +2863,8 @@ CreateMemoryBlock ( > &MappedAddr, > &Mapping > ); > - if (EFI_ERROR (Status)) { > - return Status; > + if (EFI_ERROR (Status) || (TempPtr =3D=3D NULL)) { > + return EFI_OUT_OF_RESOURCES; > } >=20 > Ptr =3D TempPtr; > -- > 2.7.0.windows.1