public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] EmbeddedPkg/PrePiMemoryAllocationLib: use correct size for pool hob
@ 2021-01-06 10:29 Ard Biesheuvel
  2021-01-07 17:44 ` Leif Lindholm
  0 siblings, 1 reply; 3+ messages in thread
From: Ard Biesheuvel @ 2021-01-06 10:29 UTC (permalink / raw)
  To: devel; +Cc: gaoliming, leif, Ard Biesheuvel

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>
---
 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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] EmbeddedPkg/PrePiMemoryAllocationLib: use correct size for pool hob
  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
  0 siblings, 1 reply; 3+ messages in thread
From: Leif Lindholm @ 2021-01-07 17:44 UTC (permalink / raw)
  To: Ard Biesheuvel; +Cc: devel, gaoliming

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
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] EmbeddedPkg/PrePiMemoryAllocationLib: use correct size for pool hob
  2021-01-07 17:44 ` Leif Lindholm
@ 2021-01-08 13:53   ` Ard Biesheuvel
  0 siblings, 0 replies; 3+ messages in thread
From: Ard Biesheuvel @ 2021-01-08 13:53 UTC (permalink / raw)
  To: Leif Lindholm; +Cc: devel, gaoliming

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
>>


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-01-08 13:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox