Skip to content
Commit 1d59c5b9 authored by Sami Mujawar's avatar Sami Mujawar Committed by Ard Biesheuvel
Browse files

Platform/ARM: Fix uninitialized variable in RunAxf

RunAxf is a shell command used for running an Axf file. The
ShellDynCmdRunAxfHandler() loads an ELF file or one processed by the
Flashloader. It calls the appropriate loaders to load the file in
memory and to obtain the entry point address.

The first argument to RunAxfPivot() is the entry point address for the image
to execute. The patch
https://github.com/tianocore/edk2-platforms/commit/996047695a06167a918b07b22fcd0fbd0def5da6


changes set/way cache maintenance operations to by-VA operation. This patch
however introduced an error: 'variable StartElf is not initialized'.

Since, StartElf is the first argument to RunAxfPivot(), which is expected to
be the entry point address; RunAxfPivot() would end up branching to an
invalid address resulting in a crash.

Therefore, initialize StartElf to the entry point address before calling
RunAxfPivot().

Signed-off-by: Sami Mujawar's avatarSami Mujawar <sami.mujawar@arm.com>
Reviewed-by: default avatarArd Biesheuvel <ard.biesheuvel@arm.com>
parent 5780623d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment