From: "Andreas Färber" <afaerber@suse.de>
To: Peter Crosthwaite <peter.crosthwaite@xilinx.com>, qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
Markus Armbruster <armbru@redhat.com>,
Kirill Batuzov <batuzovk@ispras.ru>
Subject: Re: [Qemu-devel] [PATCH qom v2 2/4] hw: Fix qemu_allocate_irqs() leaks
Date: Fri, 27 Jun 2014 11:45:54 +0200 [thread overview]
Message-ID: <53AD3D52.2000807@suse.de> (raw)
In-Reply-To: <43e8afd2e93f46da84a942e6adf3dac19b115b9a.1403061437.git.peter.crosthwaite@xilinx.com>
Am 18.06.2014 09:55, schrieb Peter Crosthwaite:
> From: Andreas Färber <afaerber@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 <batuzovk@ispras.ru>
> Cc: Markus Armbruster <armbru@redhat.com>
> Cc: Peter Maydell <peter.maydell@linaro.org>
> 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>
> ---
> 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.
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
next prev parent reply other threads:[~2014-06-27 9:46 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-18 7:53 [Qemu-devel] [PATCH qom v2 0/4] QOMify IRQs Peter Crosthwaite
2014-06-18 7:54 ` [Qemu-devel] [PATCH qom v2 1/4] sdhci: Fix misuse of qemu_free_irqs() Peter Crosthwaite
2014-06-27 9:39 ` Andreas Färber
2014-06-18 7:55 ` [Qemu-devel] [PATCH qom v2 2/4] hw: Fix qemu_allocate_irqs() leaks Peter Crosthwaite
2014-06-18 14:03 ` Kirill Batuzov
2014-06-27 9:45 ` Andreas Färber [this message]
2014-06-27 10:21 ` Peter Crosthwaite
2014-06-18 7:56 ` [Qemu-devel] [PATCH qom v2 3/4] irq: Allocate IRQs individually Peter Crosthwaite
2014-06-18 7:57 ` [Qemu-devel] [PATCH qom v2 4/4] irq: Slim conversion of qemu_irq to QOM Peter Crosthwaite
2014-06-18 14:40 ` Paolo Bonzini
2014-06-19 4:57 ` Peter Crosthwaite
2014-06-19 5:47 ` Paolo Bonzini
2014-06-25 9:39 ` [Qemu-devel] [PATCH qom v2 0/4] QOMify IRQs Peter Crosthwaite
2014-06-27 9:53 ` Andreas Färber
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=53AD3D52.2000807@suse.de \
--to=afaerber@suse.de \
--cc=armbru@redhat.com \
--cc=batuzovk@ispras.ru \
--cc=peter.crosthwaite@xilinx.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).