Commit 02a89b21 authored by Isaku Yamahata's avatar Isaku Yamahata Committed by Blue Swirl
Browse files

isapc: fix segfault.

https://bugs.launchpad.net/bugs/611646


reports that ./i386-softmmu/qemu -M isapc segfaults.
This patch fixes the segfault introduced by
f885f1ea

It's because i440fx_state in pc_init1() isn't initialized.

> Core was generated by `./i386-softmmu/qemu -M isapc'.
> Program terminated with signal 11, Segmentation fault.
> [New process 19686]
>     at qemu/hw/piix_pci.c:136
> (gdb) where
>     at qemu/hw/piix_pci.c:136
>     boot_device=0x7fffe1f5b040 "cad", kernel_filename=0x0,
>     kernel_cmdline=0x6469bf "", initrd_filename=0x0,
>     cpu_model=0x654d10 "486", pci_enabled=0)
>     at qemu/hw/pc_piix.c:178
>     boot_device=0x7fffe1f5b040 "cad", kernel_filename=0x0,
>     kernel_cmdline=0x6469bf "", initrd_filename=0x0, cpu_model=0x654d10 "486")
>     at qemu/hw/pc_piix.c:207
>     envp=0x7fffe1f5b188)
>     at qemu/vl.c:2871

Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
Signed-off-by: default avatarIsaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: default avatarBlue Swirl <blauwirbel@gmail.com>
parent 95c318f5
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -104,6 +104,7 @@ static void pc_init1(ram_addr_t ram_size,
        pci_bus = i440fx_init(&i440fx_state, &piix3_devfn, isa_irq, ram_size);
    } else {
        pci_bus = NULL;
        i440fx_state = NULL;
        isa_bus_new(NULL);
    }
    isa_bus_irqs(isa_irq);