From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: Greg Kurz <groug@kaod.org>, David Gibson <david@gibson.dropbear.id.au>
Cc: Peter Maydell <peter.maydell@linaro.org>,
qemu-ppc@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [PATCH] spapr: Fix memory leak in h_client_architecture_support()
Date: Sat, 21 Mar 2020 19:06:51 +0100 [thread overview]
Message-ID: <2785805d-d6a7-a5b5-846f-500857308840@redhat.com> (raw)
In-Reply-To: <158481206205.336182.16106097429336044843.stgit@bahia.lan>
On 3/21/20 6:34 PM, Greg Kurz wrote:
> This is the only error path that needs to free the previously allocated
> ov1.
>
> Reported-by: Coverity (CID 1421924)
> Fixes: cbd0d7f36322 "spapr: Fail CAS if option vector table cannot be parsed"
> Signed-off-by: Greg Kurz <groug@kaod.org>
> ---
> hw/ppc/spapr_hcall.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c
> index 40c86e91eb89..0d50fc911790 100644
> --- a/hw/ppc/spapr_hcall.c
> +++ b/hw/ppc/spapr_hcall.c
> @@ -1726,6 +1726,7 @@ static target_ulong h_client_architecture_support(PowerPCCPU *cpu,
> }
> ov5_guest = spapr_ovec_parse_vector(ov_table, 5);
> if (!ov5_guest) {
> + spapr_ovec_cleanup(ov1_guest);
Quicker than using g_autoptr(), so for 5.0:
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> warn_report("guest didn't provide option vector 5");
> return H_PARAMETER;
> }
>
next prev parent reply other threads:[~2020-03-21 18:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-21 17:34 [PATCH] spapr: Fix memory leak in h_client_architecture_support() Greg Kurz
2020-03-21 18:06 ` Philippe Mathieu-Daudé [this message]
2020-03-22 5:32 ` 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=2785805d-d6a7-a5b5-846f-500857308840@redhat.com \
--to=philmd@redhat.com \
--cc=david@gibson.dropbear.id.au \
--cc=groug@kaod.org \
--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).