qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Fam Zheng <famz@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>
Cc: qemu-block@nongnu.org, pbonzini@redhat.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v3] block: Fix bdrv_next() memory leak
Date: Tue, 24 May 2016 09:14:31 +0800	[thread overview]
Message-ID: <20160524011431.GC14601@ad.usersys.redhat.com> (raw)
In-Reply-To: <1463764652-11290-1-git-send-email-kwolf@redhat.com>

On Fri, 05/20 19:17, Kevin Wolf wrote:
> The bdrv_next() users all leaked the BdrvNextIterator after completing
> the iteration. Simply changing bdrv_next() to free the iterator before
> returning NULL at the end of list doesn't work because some callers exit
> the loop before looking at all BDSes.
> 
> This patch moves the BdrvNextIterator from the heap to the stack of
> the caller and switches to a bdrv_first()/bdrv_next() interface for
> initialising the iterator.
> 
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>

Reviewed-by: Fam Zheng <famz@redhat.com>

  reply	other threads:[~2016-05-24  1:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-20 17:17 [Qemu-devel] [PATCH v3] block: Fix bdrv_next() memory leak Kevin Wolf
2016-05-24  1:14 ` Fam Zheng [this message]
2016-05-24  7:30 ` Kevin Wolf

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=20160524011431.GC14601@ad.usersys.redhat.com \
    --to=famz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.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).