X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=MdeModulePkg%2FLibrary%2FPiSmmCoreMemoryAllocationLib%2FMemoryAllocationLib.c;h=f0f48438f4581e2ca8411e6007c0ddb425d15ff4;hb=4e1005eca7186cbe61aaae09108f6fdf29959f22;hp=7435844fb9ad24ac0dffed695dd99c9612bbe6c0;hpb=344015785a8b3ba5a53662700d52dd7e12aa4e0c;p=mirror_edk2.git diff --git a/MdeModulePkg/Library/PiSmmCoreMemoryAllocationLib/MemoryAllocationLib.c b/MdeModulePkg/Library/PiSmmCoreMemoryAllocationLib/MemoryAllocationLib.c index 7435844fb9..f0f48438f4 100644 --- a/MdeModulePkg/Library/PiSmmCoreMemoryAllocationLib/MemoryAllocationLib.c +++ b/MdeModulePkg/Library/PiSmmCoreMemoryAllocationLib/MemoryAllocationLib.c @@ -1,7 +1,7 @@ /** @file Support routines for memory allocation routines based on SMM Core internal functions. - Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
+ Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -251,6 +251,7 @@ FreePages ( If there is not enough memory at the specified alignment remaining to satisfy the request, then NULL is returned. If Alignment is not a power of two and Alignment is not zero, then ASSERT(). + If Pages plus EFI_SIZE_TO_PAGES (Alignment) overflows, then ASSERT(). @param MemoryType The type of memory to allocate. @param Pages The number of 4 KB pages to allocate. @@ -337,6 +338,7 @@ InternalAllocateAlignedPages ( request, then NULL is returned. If Alignment is not a power of two and Alignment is not zero, then ASSERT(). + If Pages plus EFI_SIZE_TO_PAGES (Alignment) overflows, then ASSERT(). @param Pages The number of 4 KB pages to allocate. @param Alignment The requested alignment of the allocation. Must be a power of two. @@ -364,6 +366,7 @@ AllocateAlignedPages ( request, then NULL is returned. If Alignment is not a power of two and Alignment is not zero, then ASSERT(). + If Pages plus EFI_SIZE_TO_PAGES (Alignment) overflows, then ASSERT(). @param Pages The number of 4 KB pages to allocate. @param Alignment The requested alignment of the allocation. Must be a power of two. @@ -391,6 +394,7 @@ AllocateAlignedRuntimePages ( request, then NULL is returned. If Alignment is not a power of two and Alignment is not zero, then ASSERT(). + If Pages plus EFI_SIZE_TO_PAGES (Alignment) overflows, then ASSERT(). @param Pages The number of 4 KB pages to allocate. @param Alignment The requested alignment of the allocation. Must be a power of two. @@ -474,6 +478,8 @@ InternalAllocatePool ( EFI_STATUS Status; VOID *Memory; + Memory = NULL; + Status = SmmAllocatePool (MemoryType, AllocationSize, &Memory); if (EFI_ERROR (Status)) { Memory = NULL;