]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Remove ASSERT() to make AllocatePool() service match PI spec.
authorklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 26 Jan 2010 04:28:30 +0000 (04:28 +0000)
committerklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 26 Jan 2010 04:28:30 +0000 (04:28 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9815 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Core/Pei/Memory/MemoryServices.c

index 6314f759990da0212da88390a3eab410f7c0cf69..e5dac2c5814164440e0f1c6d3904084970333221 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   EFI PEI Core memory services\r
   \r
-Copyright (c) 2006, Intel Corporation                                                         \r
+Copyright (c) 2006 - 2010, Intel Corporation                                                         \r
 All rights reserved. This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
@@ -240,7 +240,10 @@ PeiAllocatePool (
   // Generally, the size of heap in temporary memory does not exceed to 64K,\r
   // so the maxmium size of pool is 0x10000 - sizeof (EFI_HOB_MEMORY_POOL)\r
   //\r
-  ASSERT (Size < 0x10000 - sizeof (EFI_HOB_MEMORY_POOL));\r
+  if (Size >= (0x10000 - sizeof (EFI_HOB_MEMORY_POOL))) {\r
+    return EFI_OUT_OF_RESOURCES;\r
+  }\r
+  \r
   Status = PeiServicesCreateHob (\r
              EFI_HOB_TYPE_MEMORY_POOL,\r
              (UINT16)(sizeof (EFI_HOB_MEMORY_POOL) + Size),\r