From cc3c7384ac61728e9949d5e64c10664fe4510179 Mon Sep 17 00:00:00 2001 From: Christian Borntraeger Date: Sun, 22 Apr 2012 23:52:19 +0000 Subject: [PATCH] S390: fix kernel_commandline handling The current handling of kernel parameters is broken. The pointer is always valid, even if no -kernel or -append is specified. We must check if the kernel rom address is valid instead, otherwise qemu might segfault. Signed-off-by: Christian Borntraeger Signed-off-by: Alexander Graf --- hw/s390-virtio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/s390-virtio.c b/hw/s390-virtio.c index 1ebe70d..c79784c 100644 --- a/hw/s390-virtio.c +++ b/hw/s390-virtio.c @@ -274,7 +274,7 @@ static void s390_init(ram_addr_t my_ram_size, memcpy(rom_ptr(INITRD_PARM_SIZE), &initrd_size, 8); } - if (kernel_cmdline) { + if (rom_ptr(KERN_PARM_AREA)) { /* we have to overwrite values in the kernel image, which are "rom" */ memcpy(rom_ptr(KERN_PARM_AREA), kernel_cmdline, strlen(kernel_cmdline) + 1); -- 2.7.4