[edk2-devel] [PATCH] MdeModulePkg/PeiMain: Substantial change for PeiAllocatePool

Liming Gao liming.gao at intel.com
Tue Jun 18 05:16:11 UTC 2019


>-----Original Message-----
>From: Wu, Hao A
>Sent: Tuesday, June 18, 2019 1:15 PM
>To: devel at edk2.groups.io; lersek at redhat.com; Gao, Zhichao
><zhichao.gao at intel.com>; Gao, Liming <liming.gao at intel.com>
>Cc: Bret Barkelew <Bret.Barkelew at microsoft.com>; Wang, Jian J
><jian.j.wang at intel.com>; Ni, Ray <ray.ni at intel.com>; Zeng, Star
><star.zeng at intel.com>; Sean Brogan <sean.brogan at microsoft.com>; Michael
>Turner <Michael.Turner at microsoft.com>
>Subject: RE: [edk2-devel] [PATCH] MdeModulePkg/PeiMain: Substantial
>change for PeiAllocatePool
>
>> -----Original Message-----
>> From: devel at edk2.groups.io [mailto:devel at edk2.groups.io] On Behalf Of
>> Laszlo Ersek
>> Sent: Wednesday, June 12, 2019 4:34 PM
>> To: devel at edk2.groups.io; Gao, Zhichao
>> Cc: Bret Barkelew; Wang, Jian J; Wu, Hao A; Ni, Ray; Zeng, Star; Gao, Liming;
>> Sean Brogan; Michael Turner
>> Subject: Re: [edk2-devel] [PATCH] MdeModulePkg/PeiMain: Substantial
>> change for PeiAllocatePool
>>
>> Hi Zhichao,
>>
>> On 06/12/19 06:50, Gao, Zhichao wrote:
>> > From: Bret Barkelew <Bret.Barkelew at microsoft.com>
>> >
>> > 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.
>
>
>Looks to me like a valid enhancement for error handling.
>
>Liming,
>Do you have any comment on this one?
>
I agree the code change. With subject update, Reviewed-by: Liming Gao <liming.gao at intel.com>


>Best Regards,
>Hao Wu
>
>
>>
>> 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 <jian.j.wang at intel.com>
>> > Cc: Hao Wu <hao.a.wu at intel.com>
>> > Cc: Ray Ni <ray.ni at intel.com>
>> > Cc: Star Zeng <star.zeng at intel.com>
>> > Cc: Liming Gao <liming.gao at intel.com>
>> > Cc: Sean Brogan <sean.brogan at microsoft.com>
>> > Cc: Michael Turner <Michael.Turner at microsoft.com>
>> > Cc: Bret Barkelew <Bret.Barkelew at microsoft.com>
>> > Signed-off-by: Zhichao Gao <zhichao.gao at intel.com>
>> > ---
>> >  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;
>> >  }
>> >
>>
>>
>> 


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#42529): https://edk2.groups.io/g/devel/message/42529
Mute This Topic: https://groups.io/mt/32038027/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-





More information about the edk2-devel-archive mailing list