summaryrefslogtreecommitdiff
path: root/hw/sh4
diff options
context:
space:
mode:
authorAndreas Färber <afaerber@suse.de>2014-06-18 00:55:18 -0700
committerAndreas Färber <afaerber@suse.de>2014-06-30 21:13:30 +0200
commitf3c7d0389fe8a2792fd4c1cf151b885de03c8f62 (patch)
tree17a37a957d51c956c3c9e98b8e4cdd6ac1adf3dd /hw/sh4
parent127a4e1a51c038ec9167083b65d376dddcc64530 (diff)
hw: Fix qemu_allocate_irqs() leaks
Replace qemu_allocate_irqs(foo, bar, 1)[0] with qemu_allocate_irq(foo, bar, 0). This avoids leaking the dereferenced qemu_irq *. Cc: Markus Armbruster <armbru@redhat.com> Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Andreas Färber <afaerber@suse.de> [PC Changes: * Applied change to instance in sh4/sh7750.c ] Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Reviewed-by: Kirill Batuzov <batuzovk@ispras.ru> [AF: Fix IRQ index in sh4/sh7750.c] Cc: qemu-stable@nongnu.org Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'hw/sh4')
-rw-r--r--hw/sh4/sh7750.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/hw/sh4/sh7750.c b/hw/sh4/sh7750.c
index 4a39357529..5dda5de34e 100644
--- a/hw/sh4/sh7750.c
+++ b/hw/sh4/sh7750.c
@@ -838,6 +838,5 @@ SH7750State *sh7750_init(SuperHCPU *cpu, MemoryRegion *sysmem)
qemu_irq sh7750_irl(SH7750State *s)
{
sh_intc_toggle_source(sh_intc_source(&s->intc, IRL), 1, 0); /* enable */
- return qemu_allocate_irqs(sh_intc_set_irl, sh_intc_source(&s->intc, IRL),
- 1)[0];
+ return qemu_allocate_irq(sh_intc_set_irl, sh_intc_source(&s->intc, IRL), 0);
}