public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Ard Biesheuvel" <ard.biesheuvel@arm.com>
To: Leif Lindholm <leif@nuviainc.com>
Cc: devel@edk2.groups.io, gaoliming@byosoft.com.cn
Subject: Re: [PATCH] EmbeddedPkg/PrePiMemoryAllocationLib: use correct size for pool hob
Date: Fri, 8 Jan 2021 14:53:35 +0100	[thread overview]
Message-ID: <207c3433-2d6d-b070-a873-f5eb3461b1fb@arm.com> (raw)
In-Reply-To: <20210107174402.GG1664@vanye>

On 1/7/21 6:44 PM, Leif Lindholm wrote:
> On Wed, Jan 06, 2021 at 11:29:25 +0100, Ard Biesheuvel wrote:
>> Use the correct type in the sizeof() expression to calculate the size
>> of the newly allocated EFI_HOB_MEMORY_POOL hob.
>>
>> Link: https://bugzilla.tianocore.org/show_bug.cgi?id=3139
>> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
> 
> Reviewed-by: Leif Lindholm <leif@nuviainc.com>
> 

Thanks. Merged as #1322

>> ---
>>  EmbeddedPkg/Library/PrePiMemoryAllocationLib/MemoryAllocationLib.c | 4 +++-
>>  1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/EmbeddedPkg/Library/PrePiMemoryAllocationLib/MemoryAllocationLib.c b/EmbeddedPkg/Library/PrePiMemoryAllocationLib/MemoryAllocationLib.c
>> index 6d233acb98d7..bae6682c72b6 100644
>> --- a/EmbeddedPkg/Library/PrePiMemoryAllocationLib/MemoryAllocationLib.c
>> +++ b/EmbeddedPkg/Library/PrePiMemoryAllocationLib/MemoryAllocationLib.c
>> @@ -184,7 +184,9 @@ AllocatePool (
>>      return 0;
>>    } else {
>>  
>> -    Hob = (EFI_HOB_MEMORY_POOL *)CreateHob (EFI_HOB_TYPE_MEMORY_POOL, (UINT16)(sizeof (EFI_HOB_TYPE_MEMORY_POOL) + AllocationSize));
>> +    Hob = (EFI_HOB_MEMORY_POOL *)CreateHob (EFI_HOB_TYPE_MEMORY_POOL,
>> +                                   (UINT16)(sizeof (EFI_HOB_MEMORY_POOL) +
>> +                                            AllocationSize));
>>      return (VOID *)(Hob + 1);
>>    }
>>  }
>> -- 
>> 2.17.1
>>


      reply	other threads:[~2021-01-08 13:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-06 10:29 [PATCH] EmbeddedPkg/PrePiMemoryAllocationLib: use correct size for pool hob Ard Biesheuvel
2021-01-07 17:44 ` Leif Lindholm
2021-01-08 13:53   ` Ard Biesheuvel [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=207c3433-2d6d-b070-a873-f5eb3461b1fb@arm.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox