summaryrefslogtreecommitdiffstats
path: root/ArmPlatformPkg
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2017-04-06 13:10:41 +0100
committerArd Biesheuvel <ard.biesheuvel@linaro.org>2017-04-06 21:31:48 +0100
commit1fe11382db9b2c5acf5d0a131c7049ce42992d30 (patch)
tree1be9137727fc6fc7afd64a20327945f56411d0ce /ArmPlatformPkg
parente87dca691ecc92c5ae913d51a2e72e8bce7c90ed (diff)
downloadedk2-1fe11382db9b2c5acf5d0a131c7049ce42992d30.tar.gz
edk2-1fe11382db9b2c5acf5d0a131c7049ce42992d30.tar.bz2
edk2-1fe11382db9b2c5acf5d0a131c7049ce42992d30.zip
ArmPlatformPkg/PL111LcdArmVExpressLib: fix incorrect FreePool () call
When we fail to modify the memory attributes for the VRAM allocation, the allocation - which was made using AllocatePages() - is freed using FreePool(). This is incorrect by itself, but it masks a second bug, i.e., that the address of the allocation is not in VramBaseAddress but in *VramBaseAddress. So fix both issues. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Jeremy Linton <jeremy.linton@arm.com> Tested-by: Ryan Harkin <ryan.harkin@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Diffstat (limited to 'ArmPlatformPkg')
-rw-r--r--ArmPlatformPkg/ArmVExpressPkg/Library/PL111LcdArmVExpressLib/PL111LcdArmVExpress.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ArmPlatformPkg/ArmVExpressPkg/Library/PL111LcdArmVExpressLib/PL111LcdArmVExpress.c b/ArmPlatformPkg/ArmVExpressPkg/Library/PL111LcdArmVExpressLib/PL111LcdArmVExpress.c
index 2000c9bdf4..a8125e81da 100644
--- a/ArmPlatformPkg/ArmVExpressPkg/Library/PL111LcdArmVExpressLib/PL111LcdArmVExpress.c
+++ b/ArmPlatformPkg/ArmVExpressPkg/Library/PL111LcdArmVExpressLib/PL111LcdArmVExpress.c
@@ -195,7 +195,7 @@ LcdPlatformGetVram (
Status = Cpu->SetMemoryAttributes(Cpu, *VramBaseAddress, *VramSize, EFI_MEMORY_UC);
ASSERT_EFI_ERROR(Status);
if (EFI_ERROR(Status)) {
- gBS->FreePool(VramBaseAddress);
+ gBS->FreePages (*VramBaseAddress, EFI_SIZE_TO_PAGES(*VramSize));
return Status;
}
break;