On Fri, Jun 27, 2014 at 7:45 PM, Andreas Färber <afaer...@suse.de> wrote: > Am 18.06.2014 09:55, schrieb Peter Crosthwaite: >> From: Andreas Färber <afaer...@suse.de> >> >> Replace qemu_allocate_irqs(foo, bar, 1)[0] >> with qemu_allocate_irq(foo, bar, 0). >> >> This avoids leaking the dereferenced qemu_irq *. >> >> Cc: Kirill Batuzov <batuz...@ispras.ru> >> Cc: Markus Armbruster <arm...@redhat.com> >> Cc: Peter Maydell <peter.mayd...@linaro.org> >> Reviewed-by: Peter Crosthwaite <peter.crosthwa...@xilinx.com> >> Reviewed-by: Peter Maydell <peter.mayd...@linaro.org> >> Signed-off-by: Andreas Färber <afaer...@suse.de> >> [PC Changes: >> * Applied change to instance in sh4/sh7750.c >> ] >> Signed-off-by: Peter Crosthwaite <peter.crosthwa...@xilinx.com> >> --- >> Changed since 1: >> Applied change to instance in sh4/sh7750.c (Kirill review) > [...] >> diff --git a/hw/sh4/sh7750.c b/hw/sh4/sh7750.c >> index 4a39357..9ccd770 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), 1); > > Thanks for catching this, my grep expression failed due to the line > break. But shouldn't this be 0 due to the zero-based index, as per my > commit message? Will fix up unless I hear objections. >
Yep, sorry. Regards, Peter > Regards, > Andreas > >> } > > -- > SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany > GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg >