From 1fc17d768f44860bebeba03bf2e996c20c9dd08d Mon Sep 17 00:00:00 2001 From: hhuan13 Date: Thu, 4 Mar 2010 01:48:52 +0000 Subject: [PATCH] Remove Size==0 branch in SmmAllocatePool() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- MdeModulePkg/Core/PiSmmCore/Pool.c | 5 ----- 1 file changed, 5 deletions(-) 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); -- 2.39.2