summaryrefslogtreecommitdiff
path: root/ArmPkg
diff options
context:
space:
mode:
authorHeyi Guo <heyi.guo@linaro.org>2015-09-02 16:29:31 +0000
committerleiflindholm <leiflindholm@Edk2>2015-09-02 16:29:31 +0000
commitda7056309218ae3cda95f8512c3f94e4d9a55c16 (patch)
treefdebd4034ea1f036f75fedad2a32107905f11611 /ArmPkg
parentf858b8715d8c5fcab2be5af8af087684f959668a (diff)
downloadedk2-platforms-da7056309218ae3cda95f8512c3f94e4d9a55c16.tar.xz
ArmPkg: Bug fix for UncachedMemoryAllocationLib
NewNode is the node we found, while Node is the last node in the list. Also update mFreedBufferSize. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Heyi Guo <heyi.guo@linaro.org> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18390 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ArmPkg')
-rw-r--r--ArmPkg/Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/ArmPkg/Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.c b/ArmPkg/Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.c
index e70d8777d7..b859f63c2b 100644
--- a/ArmPkg/Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.c
+++ b/ArmPkg/Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.c
@@ -125,9 +125,10 @@ AllocatePagesFromList (
}
// Check if we have found a node that could contain our new allocation
if (NewNode != NULL) {
- NewNode->Allocated = TRUE;
- Node->Allocation = (VOID*)(UINTN)Node->Base;
- *Allocation = Node->Allocation;
+ NewNode->Allocated = TRUE;
+ NewNode->Allocation = (VOID*)(UINTN)NewNode->Base;
+ *Allocation = NewNode->Allocation;
+ mFreedBufferSize -= NewNode->Pages * EFI_PAGE_SIZE;
return EFI_SUCCESS;
}