diff mbox

[edk2,2/5] ArmPkg: fix pointer indirection bug in BdsFirmwareVolumeLoadImage()

Message ID 1430837315-7388-3-git-send-email-ard.biesheuvel@linaro.org
State New
Headers show

Commit Message

Ard Biesheuvel May 5, 2015, 2:48 p.m. UTC
The EFI_FIRMWARE_VOLUME2_PROTOCOL::EFI_FV_READ_SECTION prototype
takes a pointer to a pointer to an output buffer, so we should
not dereference Image (which is a pointer to pointer type itself)
but pass its value directly.

Contributed-under: TianoCore Contribution Agreement 1.0
Reviewed-by: Olivier Martin <olivier.martin@arm.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
 ArmPkg/Library/BdsLib/BdsFilePath.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

diff --git a/ArmPkg/Library/BdsLib/BdsFilePath.c b/ArmPkg/Library/BdsLib/BdsFilePath.c
index a0a949d0147a..53af9ee76d36 100644
--- a/ArmPkg/Library/BdsLib/BdsFilePath.c
+++ b/ArmPkg/Library/BdsLib/BdsFilePath.c
@@ -697,7 +697,7 @@  BdsFirmwareVolumeLoadImage (
         Status = FwVol->ReadFile (
                                 FwVol,
                                 FvNameGuid,
-                                (VOID*)(UINTN)(*Image),
+                                (VOID**)Image,
                                 ImageSize,
                                 &FvType,
                                 &Attrib,