]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Core/Dxe/Mem/Pool.c
Enhance the error handling for AllocatePool and AllocatePages function.
[mirror_edk2.git] / MdeModulePkg / Core / Dxe / Mem / Pool.c
index 2808905eabc594e0e7ed64943033f566ad4aa93e..a435b9760c0e3e9dd812c7b75498efa4af2ad130 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   UEFI Memory pool management functions.\r
 \r
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
 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
@@ -167,7 +167,7 @@ LookupPoolHead (
   @param  Buffer                 The address to return a pointer to the allocated\r
                                  pool\r
 \r
-  @retval EFI_INVALID_PARAMETER  PoolType not valid\r
+  @retval EFI_INVALID_PARAMETER  PoolType not valid or Buffer is NULL. \r
   @retval EFI_OUT_OF_RESOURCES   Size exceeds max pool size or allocation failed.\r
   @retval EFI_SUCCESS            Pool successfully allocated.\r
 \r
@@ -190,6 +190,10 @@ CoreAllocatePool (
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
+  if (Buffer == NULL) {\r
+    return EFI_INVALID_PARAMETER;\r
+  }\r
+\r
   *Buffer = NULL;\r
 \r
   //\r