EmbeddedPkg/PrePiMemoryAllocationLib: use correct size for pool hob

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>
This commit is contained in:
Ard Biesheuvel 2021-01-06 11:26:34 +01:00 committed by mergify[bot]
parent 7e6776deaf
commit 1819817155
1 changed files with 3 additions and 1 deletions

View File

@ -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);
}
}