summaryrefslogtreecommitdiff
path: root/hw/s390-virtio.c
diff options
context:
space:
mode:
authorChristian Borntraeger <borntraeger@de.ibm.com>2012-04-22 23:52:19 +0000
committerAlexander Graf <agraf@suse.de>2012-05-01 21:04:06 +0200
commitcc3c7384ac61728e9949d5e64c10664fe4510179 (patch)
tree0b13d5afc9963f412f545a893462b21ac91db5db /hw/s390-virtio.c
parentb754e4fc1e8e68af975c545c38ebc3b001ebc98f (diff)
downloadqemu-cc3c7384ac61728e9949d5e64c10664fe4510179.zip
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 <borntraeger@de.ibm.com> Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'hw/s390-virtio.c')
-rw-r--r--hw/s390-virtio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/s390-virtio.c b/hw/s390-virtio.c
index 1ebe70d0e3..c79784c0c8 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);