diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2015-04-01 18:13:21 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2015-04-01 18:13:21 +0100 |
commit | 289494da25c5d6270e66a40267fd761ee8f54a90 (patch) | |
tree | 76634082a72524f101db52988b7508c7ed7eda62 /hw/arm/virt.c | |
parent | fde069f751a9aa7e597c9d297a9995eca418a403 (diff) | |
parent | 25b9fb107bc1f6735fdb3fce537792f5db95f78d (diff) |
Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20150401' into staging
target-arm:
* Fix broken migration on AArch64 KVM
* Fix minor memory leaks in virt, vexpress, highbank
* Honour requested filename when loading highbank rom image
# gpg: Signature made Wed Apr 1 18:06:09 2015 BST using RSA key ID 14360CDE
# gpg: Good signature from "Peter Maydell <peter.maydell@linaro.org>"
* remotes/pmaydell/tags/pull-target-arm-20150401:
target-arm: kvm64 fix save/restore of SPSR regs
target-arm: kvm64 sync FP register state
hw/intc: arm_gic_kvm.c restore config first
target-arm: kvm: save/restore mp state
target-arm: Store SPSR_EL1 state in banked_spsr[1] (SPSR_svc)
hw/arm/virt: Fix memory leak reported by Coverity
hw/arm/vexpress: Fix memory leak reported by Coverity
hw/arm/highbank: Fix resource leak and wrong image loading
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/arm/virt.c')
-rw-r--r-- | hw/arm/virt.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/hw/arm/virt.c b/hw/arm/virt.c index b652b07ced..7d082e233c 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -553,6 +553,7 @@ static void create_flash(const VirtBoardInfo *vbi) if (bios_name) { char *fn; + int image_size; if (drive_get(IF_PFLASH, 0, 0)) { error_report("The contents of the first flash device may be " @@ -561,7 +562,13 @@ static void create_flash(const VirtBoardInfo *vbi) exit(1); } fn = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name); - if (!fn || load_image_targphys(fn, flashbase, flashsize) < 0) { + if (!fn) { + error_report("Could not find ROM image '%s'", bios_name); + exit(1); + } + image_size = load_image_targphys(fn, flashbase, flashsize); + g_free(fn); + if (image_size < 0) { error_report("Could not load ROM image '%s'", bios_name); exit(1); } |