From: "Leif Lindholm" <leif@nuviainc.com>
To: Ard Biesheuvel <ard.biesheuvel@arm.com>
Cc: devel@edk2.groups.io, gaoliming@byosoft.com.cn
Subject: Re: [PATCH] EmbeddedPkg/PrePiMemoryAllocationLib: use correct size for pool hob
Date: Thu, 7 Jan 2021 17:44:02 +0000 [thread overview]
Message-ID: <20210107174402.GG1664@vanye> (raw)
In-Reply-To: <20210106102925.9808-1-ard.biesheuvel@arm.com>
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>
> ---
> 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
>
next prev parent reply other threads:[~2021-01-07 17:44 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 [this message]
2021-01-08 13:53 ` Ard Biesheuvel
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=20210107174402.GG1664@vanye \
--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