qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: Anthony PERARD <anthony.perard@citrix.com>
Cc: qemu-devel@nongnu.org,
	Stefano Stabellini <sstabellini@kernel.org>,
	 Paul Durrant <paul@xen.org>, Kevin Wolf <kwolf@redhat.com>,
	Hanna Reitz <hreitz@redhat.com>,
	 xen-devel@lists.xenproject.org, qemu-block@nongnu.org
Subject: Re: [PATCH] xen-block: Avoid leaks on new error path
Date: Tue, 4 Jul 2023 18:57:39 +0100	[thread overview]
Message-ID: <CAFEAcA_okj_rH3RR_a7BrOsxxEWBQGa7bGDXK1OrwCD9izVaDg@mail.gmail.com> (raw)
In-Reply-To: <20230704171819.42564-1-anthony.perard@citrix.com>

On Tue, 4 Jul 2023 at 18:19, Anthony PERARD <anthony.perard@citrix.com> wrote:
>
> From: Anthony PERARD <anthony.perard@citrix.com>
>
> Commit 189829399070 ("xen-block: Use specific blockdev driver")
> introduced a new error path, without taking care of allocated
> resources.
>
> So only allocate the qdicts after the error check, and free both
> `filename` and `driver` when we are about to return and thus taking
> care of both success and error path.
>
> Coverity only spotted the leak of qdicts (*_layer variables).
>
> Reported-by: Peter Maydell <peter.maydell@linaro.org>
> Fixes: Coverity CID 1508722, 1398649
> Fixes: 189829399070 ("xen-block: Use specific blockdev driver")
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM


  reply	other threads:[~2023-07-04 17:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-04 17:18 [PATCH] xen-block: Avoid leaks on new error path Anthony PERARD via
2023-07-04 17:57 ` Peter Maydell [this message]
2023-07-06 16:28 ` Paul Durrant

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=CAFEAcA_okj_rH3RR_a7BrOsxxEWBQGa7bGDXK1OrwCD9izVaDg@mail.gmail.com \
    --to=peter.maydell@linaro.org \
    --cc=anthony.perard@citrix.com \
    --cc=hreitz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=paul@xen.org \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.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).