Make sure that obp_arg.argv is set to an empty string if no command line is passed from QEMU. Otherwise the kernel will panic on startup when trying to access it.
Signed-off-by: Mark Cave-Ayland mark.cave-ayland@ilande.co.uk --- arch/sparc32/openbios.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/arch/sparc32/openbios.c b/arch/sparc32/openbios.c index 17a6550..c03847c 100644 --- a/arch/sparc32/openbios.c +++ b/arch/sparc32/openbios.c @@ -922,14 +922,14 @@ arch_init( void ) ofmem_claim_virt(PAGE_ALIGN(kernel_image), PAGE_ALIGN(kernel_size), 0); }
- kernel_cmdline = (const char *) fw_cfg_read_i32(FW_CFG_KERNEL_CMDLINE); - if (kernel_cmdline) { - cmdline = strdup(kernel_cmdline); - obp_arg.argv[1] = cmdline; - } else { - cmdline = strdup(""); - } - qemu_cmdline = (uint32_t)cmdline; + kernel_cmdline = (const char *) fw_cfg_read_i32(FW_CFG_KERNEL_CMDLINE); + if (kernel_cmdline) { + cmdline = strdup(kernel_cmdline); + } else { + cmdline = strdup(""); + } + obp_arg.argv[1] = cmdline; + qemu_cmdline = (uint32_t)cmdline;
/* Setup nvram variables */ push_str("/options");