]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Remove Size==0 branch in SmmAllocatePool()
authorhhuan13 <hhuan13@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 4 Mar 2010 01:48:52 +0000 (01:48 +0000)
committerhhuan13 <hhuan13@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 4 Mar 2010 01:48:52 +0000 (01:48 +0000)
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

index 10a85c47abafb4d122092a84fbe49db8df6823ea..b38a3e0b7e190c4efe12fa23b33f266852508fa4 100644 (file)
@@ -224,11 +224,6 @@ SmmAllocatePool (
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
-  if (Size == 0) {\r
-    *Buffer = NULL;\r
-    return EFI_SUCCESS;\r
-  }\r
-\r
   Size += sizeof (*PoolHdr);\r
   if (Size > MAX_POOL_SIZE) {\r
     Size = EFI_SIZE_TO_PAGES (Size);\r