[edk2-devel] [PATCH] EmbeddedPkg/PrePiMemoryAllocationLib: use correct size for pool hob

Ard Biesheuvel ard.biesheuvel at arm.com
Fri Jan 8 13:53:35 UTC 2021


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 at arm.com>
> 
> Reviewed-by: Leif Lindholm <leif at 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
>>



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#70041): https://edk2.groups.io/g/devel/message/70041
Mute This Topic: https://groups.io/mt/79472089/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