]> git.proxmox.com Git - mirror_edk2.git/commitdiff
EmbeddedPkg/PrePiMemoryAllocationLib: use correct size for pool hob
authorArd Biesheuvel <ard.biesheuvel@arm.com>
Wed, 6 Jan 2021 10:26:34 +0000 (11:26 +0100)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Fri, 8 Jan 2021 13:37:57 +0000 (13:37 +0000)
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

index 6d233acb98d73c3e8352a4144159a89020355ee0..bae6682c72b6b9d160b26b2af4d76c1344925753 100644 (file)
@@ -184,7 +184,9 @@ AllocatePool (
     return 0;\r
   } else {\r
 \r
-    Hob = (EFI_HOB_MEMORY_POOL *)CreateHob (EFI_HOB_TYPE_MEMORY_POOL, (UINT16)(sizeof (EFI_HOB_TYPE_MEMORY_POOL) + AllocationSize));\r
+    Hob = (EFI_HOB_MEMORY_POOL *)CreateHob (EFI_HOB_TYPE_MEMORY_POOL,\r
+                                   (UINT16)(sizeof (EFI_HOB_MEMORY_POOL) +\r
+                                            AllocationSize));\r
     return (VOID *)(Hob + 1);\r
   }\r
 }\r