]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Core/Dxe/Mem/Page.c
Enhance the error handling for AllocatePool and AllocatePages function.
[mirror_edk2.git] / MdeModulePkg / Core / Dxe / Mem / Page.c
index 04844e3305fa9a21bdcca4ebede0799beba15c9b..b4a62b9f0c4988462a24e03cc854ed1b780199b9 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   UEFI Memory page management functions.\r
 \r
-Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2007 - 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
@@ -1103,6 +1103,10 @@ CoreAllocatePages (
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
+  if (Memory == NULL) {\r
+    return EFI_INVALID_PARAMETER;\r
+  }\r
+\r
   Alignment = EFI_DEFAULT_PAGE_ALLOCATION_ALIGNMENT;\r
 \r
   if  (MemoryType == EfiACPIReclaimMemory   ||\r