aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hw/pc.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/hw/pc.c b/hw/pc.c
index 69e597f3e2..b797f218f7 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -658,6 +658,12 @@ static void load_linux(void *fw_cfg,
}
initrd_size = get_image_size(initrd_filename);
+ if (initrd_size < 0) {
+ fprintf(stderr, "qemu: error reading initrd %s\n",
+ initrd_filename);
+ exit(1);
+ }
+
initrd_addr = (initrd_max-initrd_size) & ~4095;
initrd_data = qemu_malloc(initrd_size);