From: hhuan13 Date: Thu, 4 Mar 2010 01:48:52 +0000 (+0000) Subject: Remove Size==0 branch in SmmAllocatePool() X-Git-Tag: edk2-stable201903~16165 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=1fc17d768f44860bebeba03bf2e996c20c9dd08d Remove Size==0 branch in SmmAllocatePool() The background is : The SmmMemoryAllocationLib of one of the instance of MemoryAllocation library class. As in MdePkg comment for AllocatePool() : “If AllocationSize is 0, then a valid buffer of 0 size is returned.”,the SMM library implements AllocatePool by SMST service SmmAllocatePool which does NOT support the zero size. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10171 6f19259b-4bc3-4df7-8a09-765794883524 --- diff --git a/MdeModulePkg/Core/PiSmmCore/Pool.c b/MdeModulePkg/Core/PiSmmCore/Pool.c index 10a85c47ab..b38a3e0b7e 100644 --- a/MdeModulePkg/Core/PiSmmCore/Pool.c +++ b/MdeModulePkg/Core/PiSmmCore/Pool.c @@ -224,11 +224,6 @@ SmmAllocatePool ( return EFI_INVALID_PARAMETER; } - if (Size == 0) { - *Buffer = NULL; - return EFI_SUCCESS; - } - Size += sizeof (*PoolHdr); if (Size > MAX_POOL_SIZE) { Size = EFI_SIZE_TO_PAGES (Size);