Patchwork [v2,01/13] isapc: Fix irq routing

login
register
mail settings
Submitter Gerd Hoffmann
Date Sept. 10, 2009, 9:43 a.m.
Message ID <1252575815-7824-2-git-send-email-kraxel@redhat.com>
Download mbox | patch
Permalink /patch/33296/
State Superseded
Headers show

Comments

Gerd Hoffmann - Sept. 10, 2009, 9:43 a.m.
Only send irqs to ioapic in case we have one.
Fixes qemu segfault.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/pc.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

Patch

diff --git a/hw/pc.c b/hw/pc.c
index 6292001..9af0cdb 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -100,7 +100,8 @@  static void isa_irq_handler(void *opaque, int n, int level)
     if (n < 16) {
         qemu_set_irq(isa->i8259[n], level);
     }
-    qemu_set_irq(isa->ioapic[n], level);
+    if (isa->ioapic)
+        qemu_set_irq(isa->ioapic[n], level);
 };
 
 static void ioport80_write(void *opaque, uint32_t addr, uint32_t data)