From nobody Thu Apr 25 07:34:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+42253+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+42253+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1560315023; cv=none; d=zoho.com; s=zohoarc; b=VVY+P+FYr8ToOclT8L1eX9ok7jPtKsUwqJ0snttoPaVhtLfuWBEsHhEMesf2ZQKV2Far6/WDuFTfwOGO5PkHOad1W5Upjuo6RBVpSzYt4b79ypBedCjSidQeRIiawMRF08HjJY2MtyHrl6GTZdyQEwHR+VqBOuOML98Gf6s2HFg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560315023; h=Content-Transfer-Encoding:Cc:Date:From:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To:ARC-Authentication-Results; bh=wtD02XCRKDyGQ604uKAqu5wzFRG1PhaVX7o64jFxEFw=; b=DvJb51gmXinzKqNysBHjRoGAufIOuqVffMPbMUWIVg2kd6yIlJ8Bo2RMWE5T0REdpXSDX/8y2n3YDxy4Wi6OQxCFacrvDMCFJmLi8L8a3/HE8A3vmQL2DPw1YZ3SoJndBgNr26Ss8xPY+UvHWj4A+TMGHqDsuE143auUycetM1w= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+42253+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1560315023362656.9998880198731; Tue, 11 Jun 2019 21:50:23 -0700 (PDT) Return-Path: X-Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by groups.io with SMTP; Tue, 11 Jun 2019 21:50:22 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Jun 2019 21:50:22 -0700 X-ExtLoop1: 1 X-Received: from fieedk001.ccr.corp.intel.com ([10.239.33.119]) by fmsmga001.fm.intel.com with ESMTP; 11 Jun 2019 21:50:20 -0700 From: "Gao, Zhichao" To: devel@edk2.groups.io Cc: Bret Barkelew , Jian J Wang , Hao Wu , Ray Ni , Star Zeng , Liming Gao , Sean Brogan , Michael Turner Subject: [edk2-devel] [PATCH] MdeModulePkg/PeiMain: Substantial change for PeiAllocatePool Date: Wed, 12 Jun 2019 12:50:14 +0800 Message-Id: <20190612045014.13724-1-zhichao.gao@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,zhichao.gao@intel.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1560315023; bh=sFo19dLJc+LSQs2juSNmoxHqFEAFHYtpXHULXkwEQaM=; h=Cc:Date:From:Reply-To:Subject:To; b=shNhtp04FvX2+KxRlfTrSSrHqQdaRto19acie1Hd7uPKhMJPjMiGhvCDaAmsVzLkt7Q 8ILlk6pkTvGxHeksbT6Q+87NujnyzXwLvIA5MYzppqwC2Tb+PWKVcZoWlS1RESTzh1jFe EQYRUdeEBmq9VXp8Jhxb3XnDJxDBi88U11I= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Bret Barkelew REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1901 The original logic is ASSERT if fail to create HOB. But that doesn't make sense for release version. So it is required to set the Buffer to null to indicate the failure. Cc: Jian J Wang Cc: Hao Wu Cc: Ray Ni Cc: Star Zeng Cc: Liming Gao Cc: Sean Brogan Cc: Michael Turner Cc: Bret Barkelew Signed-off-by: Zhichao Gao Acked-by: Hao A Wu --- MdeModulePkg/Core/Pei/Memory/MemoryServices.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/MdeModulePkg/Core/Pei/Memory/MemoryServices.c b/MdeModulePkg/C= ore/Pei/Memory/MemoryServices.c index 42f79ab076..37b0cfa3cf 100644 --- a/MdeModulePkg/Core/Pei/Memory/MemoryServices.c +++ b/MdeModulePkg/Core/Pei/Memory/MemoryServices.c @@ -802,7 +802,12 @@ PeiAllocatePool ( (VOID **)&Hob ); ASSERT_EFI_ERROR (Status); - *Buffer =3D Hob+1; + + if (EFI_ERROR (Status)) { + *Buffer =3D NULL; + } else { + *Buffer =3D Hob+1; + } =20 return Status; } --=20 2.21.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#42253): https://edk2.groups.io/g/devel/message/42253 Mute This Topic: https://groups.io/mt/32038027/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-