summaryrefslogtreecommitdiffstats
path: root/MdePkg/Library/SmmMemoryAllocationLib/MemoryAllocationLib.c
diff options
context:
space:
mode:
Diffstat (limited to 'MdePkg/Library/SmmMemoryAllocationLib/MemoryAllocationLib.c')
-rw-r--r--MdePkg/Library/SmmMemoryAllocationLib/MemoryAllocationLib.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/MdePkg/Library/SmmMemoryAllocationLib/MemoryAllocationLib.c b/MdePkg/Library/SmmMemoryAllocationLib/MemoryAllocationLib.c
index 3ab2c1ebfd..99a8259325 100644
--- a/MdePkg/Library/SmmMemoryAllocationLib/MemoryAllocationLib.c
+++ b/MdePkg/Library/SmmMemoryAllocationLib/MemoryAllocationLib.c
@@ -322,7 +322,7 @@ InternalAllocateAlignedPages (
// Calculate the total number of pages since alignment is larger than page size.
//
AlignmentMask = Alignment - 1;
- RealPages = Pages + EFI_SIZE_TO_PAGES (Alignment);
+ RealPages = Pages + EFI_SIZE_TO_PAGES (Alignment) - 1;
//
// Make sure that Pages plus EFI_SIZE_TO_PAGES (Alignment) does not overflow.
//