From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48197) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X0SjI-0003Hv-JO for qemu-devel@nongnu.org; Fri, 27 Jun 2014 05:46:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X0SjE-000847-0C for qemu-devel@nongnu.org; Fri, 27 Jun 2014 05:46:00 -0400 Received: from cantor2.suse.de ([195.135.220.15]:60633 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X0SjD-000842-QS for qemu-devel@nongnu.org; Fri, 27 Jun 2014 05:45:55 -0400 Message-ID: <53AD3D52.2000807@suse.de> Date: Fri, 27 Jun 2014 11:45:54 +0200 From: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= MIME-Version: 1.0 References: <43e8afd2e93f46da84a942e6adf3dac19b115b9a.1403061437.git.peter.crosthwaite@xilinx.com> In-Reply-To: <43e8afd2e93f46da84a942e6adf3dac19b115b9a.1403061437.git.peter.crosthwaite@xilinx.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH qom v2 2/4] hw: Fix qemu_allocate_irqs() leaks List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Crosthwaite , qemu-devel@nongnu.org Cc: Peter Maydell , Markus Armbruster , Kirill Batuzov Am 18.06.2014 09:55, schrieb Peter Crosthwaite: > From: Andreas F=C3=A4rber >=20 > Replace qemu_allocate_irqs(foo, bar, 1)[0] > with qemu_allocate_irq(foo, bar, 0). >=20 > This avoids leaking the dereferenced qemu_irq *. >=20 > Cc: Kirill Batuzov > Cc: Markus Armbruster > Cc: Peter Maydell > Reviewed-by: Peter Crosthwaite > Reviewed-by: Peter Maydell > Signed-off-by: Andreas F=C3=A4rber > [PC Changes: > * Applied change to instance in sh4/sh7750.c > ] > Signed-off-by: Peter Crosthwaite > --- > 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, MemoryRegi= on *sysmem) > qemu_irq sh7750_irl(SH7750State *s) > { > sh_intc_toggle_source(sh_intc_source(&s->intc, IRL), 1, 0); /* ena= ble */ > - 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. Regards, Andreas > } --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=C3=BCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=C3=B6rffer; HRB 16746 AG N=C3=BC= rnberg