Patchwork [v1,1/5] xilinx_spips: Set unused IRQs to NULL

login
register
mail settings
Submitter Peter Crosthwaite
Date Feb. 20, 2013, 7:26 a.m.
Message ID <f6e934fab3e5838b4ec54fb45b9f6b15ccb2cf3f.1361344859.git.peter.crosthwaite@xilinx.com>
Download mbox | patch
Permalink /patch/221975/
State New
Headers show

Comments

Peter Crosthwaite - Feb. 20, 2013, 7:26 a.m.
Unused CS lines should init to 0 to avoid segfaulting when accessing an
unattached QSPI controller.

Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
---

 hw/xilinx_spips.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Patch

diff --git a/hw/xilinx_spips.c b/hw/xilinx_spips.c
index 42e019d..3eee828 100644
--- a/hw/xilinx_spips.c
+++ b/hw/xilinx_spips.c
@@ -497,7 +497,7 @@  static int xilinx_spips_init(SysBusDevice *dev)
         s->spi[i] = ssi_create_bus(&dev->qdev, bus_name);
     }
 
-    s->cs_lines = g_new(qemu_irq, s->num_cs * s->num_busses);
+    s->cs_lines = g_new0(qemu_irq, s->num_cs * s->num_busses);
     ssi_auto_connect_slaves(DEVICE(s), s->cs_lines, s->spi[0]);
     ssi_auto_connect_slaves(DEVICE(s), s->cs_lines, s->spi[1]);
     sysbus_init_irq(dev, &s->irq);