Patchwork [Bug,611646,NEW] isa bus not working

login
register
mail settings
Submitter Isaku Yamahata
Date Aug. 2, 2010, 8:53 a.m.
Message ID <20100802085339.GA9761@valinux.co.jp>
Download mbox | patch
Permalink /patch/60521/
State New
Headers show

Comments

Isaku Yamahata - Aug. 2, 2010, 8:53 a.m.
Sorry for that.
Does the attached patch fix it?

From 20b13fa4a2c5e755346f7a91d44d23dd781a87fa Mon Sep 17 00:00:00 2001
Message-Id: <20b13fa4a2c5e755346f7a91d44d23dd781a87fa.1280738898.git.yamahata@valinux.co.jp>
In-Reply-To: <cover.1280738898.git.yamahata@valinux.co.jp>
References: <cover.1280738898.git.yamahata@valinux.co.jp>
From: Isaku Yamahata <yamahata@valinux.co.jp>
Date: Mon, 2 Aug 2010 17:47:07 +0900
Subject: [PATCH] isapc: fix segfault.

This patch fixes the following segfault introduced by
f885f1eaa8711c06033ceb1599e3750fb37c306f
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 /home/yamahata/xen/iommu/qemu/git/mkpatch/qemu-isapc-fix-0/hw/piix_pci.c:136
> (gdb) where
>     at /home/yamahata/xen/iommu/qemu/git/mkpatch/qemu-isapc-fix-0/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 /home/yamahata/xen/iommu/qemu/git/mkpatch/qemu-isapc-fix-0/hw/pc_piix.c:178
>     boot_device=0x7fffe1f5b040 "cad", kernel_filename=0x0,
>     kernel_cmdline=0x6469bf "", initrd_filename=0x0, cpu_model=0x654d10 "486")
>     at /home/yamahata/xen/iommu/qemu/git/mkpatch/qemu-isapc-fix-0/hw/pc_piix.c:207
>     envp=0x7fffe1f5b188)
>     at /home/yamahata/xen/iommu/qemu/git/mkpatch/qemu-isapc-fix-0/vl.c:2871

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
---
 hw/pc_piix.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Patch

diff --git a/hw/pc_piix.c b/hw/pc_piix.c
index 812ddfd..634e8e6 100644
--- a/hw/pc_piix.c
+++ b/hw/pc_piix.c
@@ -69,7 +69,7 @@  static void pc_init1(ram_addr_t ram_size,
     int i;
     ram_addr_t below_4g_mem_size, above_4g_mem_size;
     PCIBus *pci_bus;
-    PCII440FXState *i440fx_state;
+    PCII440FXState *i440fx_state = NULL;
     int piix3_devfn = -1;
     qemu_irq *cpu_irq;
     qemu_irq *isa_irq;