From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: redhat.com, ip: 209.132.183.28, mailfrom: lersek@redhat.com) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by groups.io with SMTP; Wed, 12 Jun 2019 01:34:16 -0700 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D6C898F916; Wed, 12 Jun 2019 08:34:03 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-117-191.ams2.redhat.com [10.36.117.191]) by smtp.corp.redhat.com (Postfix) with ESMTP id DF54660CCC; Wed, 12 Jun 2019 08:33:58 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH] MdeModulePkg/PeiMain: Substantial change for PeiAllocatePool To: devel@edk2.groups.io, zhichao.gao@intel.com Cc: Bret Barkelew , Jian J Wang , Hao Wu , Ray Ni , Star Zeng , Liming Gao , Sean Brogan , Michael Turner References: <20190612045014.13724-1-zhichao.gao@intel.com> From: "Laszlo Ersek" Message-ID: <5d2aa3bd-1acc-7048-7675-e3e9da217415@redhat.com> Date: Wed, 12 Jun 2019 10:33:58 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20190612045014.13724-1-zhichao.gao@intel.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 12 Jun 2019 08:34:04 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Hi Zhichao, On 06/12/19 06:50, Gao, Zhichao wrote: > From: Bret Barkelew > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1901 > > 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. this patch may or may not be worthwhile; that's for the PEI Core maintainers to evaluate. Either way, the subject line is completely useless. "Substantial change" means nothing at all. Please write a subject line that reflects what this patch *actually does*. For example: MdeModulePkg/PeiMain: PeiAllocatePool: output NULL if HOB creation fails (72 characters). Thanks Laszlo > 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 > --- > 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/Core/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 = Hob+1; > + > + if (EFI_ERROR (Status)) { > + *Buffer = NULL; > + } else { > + *Buffer = Hob+1; > + } > > return Status; > } >