diff options
| author | Peter Maydell | 2020-03-24 13:12:16 +0100 |
|---|---|---|
| committer | David Gibson | 2020-04-07 00:55:10 +0200 |
| commit | 3b4f50bd7d16322a109a026a87a945dff660f38b (patch) | |
| tree | 66fab3764cb116c4cc249705a5c6818ad16cbca4 /target | |
| parent | Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20200406'... (diff) | |
| download | qemu-3b4f50bd7d16322a109a026a87a945dff660f38b.tar.gz qemu-3b4f50bd7d16322a109a026a87a945dff660f38b.tar.xz qemu-3b4f50bd7d16322a109a026a87a945dff660f38b.zip | |
hw/ppc/e500.c: Handle qemu_find_file() failure
If qemu_find_file() doesn't find the BIOS it returns NULL; we were
passing that unchecked through to load_elf(), which assumes a non-NULL
pointer and may misbehave. In practice it fails with a weird message:
$ qemu-system-ppc -M ppce500 -display none -kernel nonesuch
Bad address
qemu-system-ppc: could not load firmware '(null)'
Handle the failure case better:
$ qemu-system-ppc -M ppce500 -display none -kernel nonesuch
qemu-system-ppc: could not find firmware/kernel file 'nonesuch'
Spotted by Coverity (CID 1238954).
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-Id: <20200324121216.23899-1-peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'target')
0 files changed, 0 insertions, 0 deletions
