]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPkg: Bug fix for UncachedMemoryAllocationLib
authorHeyi Guo <heyi.guo@linaro.org>
Wed, 2 Sep 2015 16:29:31 +0000 (16:29 +0000)
committerleiflindholm <leiflindholm@Edk2>
Wed, 2 Sep 2015 16:29:31 +0000 (16:29 +0000)
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

ArmPkg/Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.c

index e70d8777d76d47706565cbd69e92dc15ff200399..b859f63c2b5a0256b01f650a4f29bce4ecf893de 100644 (file)
@@ -125,9 +125,10 @@ AllocatePagesFromList (
   }\r
   // Check if we have found a node that could contain our new allocation\r
   if (NewNode != NULL) {\r
-    NewNode->Allocated = TRUE;\r
-    Node->Allocation   = (VOID*)(UINTN)Node->Base;\r
-    *Allocation        = Node->Allocation;\r
+    NewNode->Allocated  = TRUE;\r
+    NewNode->Allocation = (VOID*)(UINTN)NewNode->Base;\r
+    *Allocation         = NewNode->Allocation;\r
+    mFreedBufferSize    -= NewNode->Pages * EFI_PAGE_SIZE;\r
     return EFI_SUCCESS;\r
   }\r
 \r