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
This commit is contained in:
Heyi Guo 2015-09-02 16:29:31 +00:00 committed by leiflindholm
parent f858b8715d
commit da70563092
1 changed files with 4 additions and 3 deletions

View File

@ -126,8 +126,9 @@ AllocatePagesFromList (
// Check if we have found a node that could contain our new allocation // Check if we have found a node that could contain our new allocation
if (NewNode != NULL) { if (NewNode != NULL) {
NewNode->Allocated = TRUE; NewNode->Allocated = TRUE;
Node->Allocation = (VOID*)(UINTN)Node->Base; NewNode->Allocation = (VOID*)(UINTN)NewNode->Base;
*Allocation = Node->Allocation; *Allocation = NewNode->Allocation;
mFreedBufferSize -= NewNode->Pages * EFI_PAGE_SIZE;
return EFI_SUCCESS; return EFI_SUCCESS;
} }