qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>, qemu-devel@nongnu.org
Cc: qemu-ppc@nongnu.org, David Gibson <david@gibson.dropbear.id.au>
Subject: Re: [Qemu-devel] [PATCH for-3.1] hw/ppc/mac_newworld: Free openpic_irqs array after use
Date: Thu, 1 Nov 2018 18:37:11 +0100	[thread overview]
Message-ID: <2e3320e1-a69b-3408-3676-3869b6826bee@redhat.com> (raw)
In-Reply-To: <20181101161758.12300-1-peter.maydell@linaro.org>

On 1/11/18 17:17, Peter Maydell wrote:
> In ppc_core99_init(), we allocate an openpic_irqs array, which
> we then use to collect up the various qemu_irqs which we're
> going to connect to the interrupt controller. Once we've
> called sysbus_connect_irq() to connect them all up, the
> array is no longer required, but we forgot to free it.
> 
> Since board init is only run once at startup, the memory
> leak is not a significant one.
> 
> Spotted by Coverity: CID 1192916.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>

> ---
>   hw/ppc/mac_newworld.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c
> index a630cb81cd8..14273a123e5 100644
> --- a/hw/ppc/mac_newworld.c
> +++ b/hw/ppc/mac_newworld.c
> @@ -303,6 +303,7 @@ static void ppc_core99_init(MachineState *machine)
>               sysbus_connect_irq(s, k++, openpic_irqs[i][j]);
>           }
>       }
> +    g_free(openpic_irqs);
>   
>       if (PPC_INPUT(env) == PPC_FLAGS_INPUT_970) {
>           /* 970 gets a U3 bus */
> 

  reply	other threads:[~2018-11-01 17:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-01 16:17 [Qemu-devel] [PATCH for-3.1] hw/ppc/mac_newworld: Free openpic_irqs array after use Peter Maydell
2018-11-01 17:37 ` Philippe Mathieu-Daudé [this message]
2018-11-02 11:14 ` Mark Cave-Ayland
2018-11-02 11:19   ` Peter Maydell
2018-11-03 12:59 ` David Gibson

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=2e3320e1-a69b-3408-3676-3869b6826bee@redhat.com \
    --to=philmd@redhat.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@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).