]> git.proxmox.com Git - mirror_qemu.git/commitdiff
microblaze: boot.c: Don't try to find NULL file
authorAlistair Francis <alistair.francis@xilinx.com>
Mon, 22 Jan 2018 19:43:16 +0000 (11:43 -0800)
committerEdgar E. Iglesias <edgar.iglesias@xilinx.com>
Fri, 26 Jan 2018 10:09:02 +0000 (11:09 +0100)
Previously if no device tree was passed to microblaze_load_kernel() then
qemu_find_file() would try to find a NULL pointer. To avoid this put a
check around qemu_find_file().

Signed-off-by: Alistair Francis <alistair.francis@xilinx.com>
Reported-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
hw/microblaze/boot.c

index 457a08a2fe3241af765c2fa5ad8c67d9798ff089..35bfeda7aa715f67a2b21c57323f77055944be5d 100644 (file)
@@ -124,7 +124,7 @@ void microblaze_load_kernel(MicroBlazeCPU *cpu, hwaddr ddr_base,
     kernel_cmdline = qemu_opt_get(machine_opts, "append");
     dtb_arg = qemu_opt_get(machine_opts, "dtb");
     /* default to pcbios dtb as passed by machine_init */
-    if (!dtb_arg) {
+    if (!dtb_arg && dtb_filename) {
         filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, dtb_filename);
     }