[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PULL 20/26] ppc/pnv: check for OPAL firmware file presence
From: |
David Gibson |
Subject: |
[Qemu-ppc] [PULL 20/26] ppc/pnv: check for OPAL firmware file presence |
Date: |
Wed, 27 Sep 2017 17:43:10 +1000 |
From: Cédric Le Goater <address@hidden>
and exit before uselessly trying to load it if the file does not
exists.
Issue discovered by Coverity Scan.
Signed-off-by: Cédric Le Goater <address@hidden>
Reviewed-by: Thomas Huth <address@hidden>
Signed-off-by: David Gibson <address@hidden>
---
hw/ppc/pnv.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c
index 47221158d4..d46d91c76f 100644
--- a/hw/ppc/pnv.c
+++ b/hw/ppc/pnv.c
@@ -570,10 +570,14 @@ static void ppc_powernv_init(MachineState *machine)
}
fw_filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
+ if (!fw_filename) {
+ error_report("Could not find OPAL firmware '%s'", bios_name);
+ exit(1);
+ }
fw_size = load_image_targphys(fw_filename, FW_LOAD_ADDR, FW_MAX_SIZE);
if (fw_size < 0) {
- error_report("Could not load OPAL '%s'", fw_filename);
+ error_report("Could not load OPAL firmware '%s'", fw_filename);
exit(1);
}
g_free(fw_filename);
--
2.13.5
- [Qemu-ppc] [PULL 25/26] macio: pass channel into MACIOIDEState via qdev property, (continued)
- [Qemu-ppc] [PULL 25/26] macio: pass channel into MACIOIDEState via qdev property, David Gibson, 2017/09/27
- [Qemu-ppc] [PULL 13/26] ppc/kvm: generalize the use of kvmppc_get_htab_fd(), David Gibson, 2017/09/27
- [Qemu-ppc] [PULL 24/26] mac_dbdma: remove DBDMA_init() function, David Gibson, 2017/09/27
- [Qemu-ppc] [PULL 23/26] mac_dbdma: QOMify, David Gibson, 2017/09/27
- [Qemu-ppc] [PULL 12/26] ppc/kvm: change kvmppc_get_htab_fd() to return -errno on error, David Gibson, 2017/09/27
- [Qemu-ppc] [PULL 19/26] ppc: remove all unused CPU definitions, David Gibson, 2017/09/27
- [Qemu-ppc] [PULL 21/26] spapr: fix the value of SDR1 in kvmppc_put_books_sregs(), David Gibson, 2017/09/27
- [Qemu-ppc] [PULL 16/26] macio: convert pmac_ide_ops from old_mmio, David Gibson, 2017/09/27
- [Qemu-ppc] [PULL 26/26] macio: use object link between MACIO_IDE and MAC_DBDMA object, David Gibson, 2017/09/27
- [Qemu-ppc] [PULL 14/26] spapr: introduce helpers to migrate HPT chunks and the end marker, David Gibson, 2017/09/27
- [Qemu-ppc] [PULL 20/26] ppc/pnv: check for OPAL firmware file presence,
David Gibson <=
- [Qemu-ppc] [PULL 22/26] mac_dbdma: remove unused IO fields from DBDMAState, David Gibson, 2017/09/27
- Re: [Qemu-ppc] [PULL 00/26] ppc-for-2.11 queue 20170927, Peter Maydell, 2017/09/27