qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Fam Zheng <famz@redhat.com>
To: "Chentao (Boby)" <boby.chen@huawei.com>
Cc: "Zhangmin (Rudy)" <rudy.zhangmin@huawei.com>,
	Qinling <mail.qinling@huawei.com>,
	qemu-devel <qemu-devel@nongnu.org>,
	"Wubin (H)" <wu.wubin@huawei.com>,
	"Wangting (Kathy)" <kathy.wangting@huawei.com>
Subject: Re: [Qemu-devel] [PATCH] drive-mirror: fix memory leak
Date: Wed, 22 Jan 2014 11:41:43 +0800	[thread overview]
Message-ID: <20140122034143.GA24497@T430.redhat.com> (raw)
In-Reply-To: <93A91DC620F1514FB39E878E5131C8CF0E360A4F@nkgeml511-mbx.china.huawei.com>

Hi,

The patch itself looks good to me, but it has too many extra empty lines
interleaved. Please try to use "git send-email" to submit your patches, for
more information, follow the instructions as in:

http://wiki.qemu.org/Contribute/SubmitAPatch

On Tue, 01/21 11:43, Chentao (Boby) wrote:
> In the function mirror_iteration() -> qemu_iovec_init(), it alloc memory for op->qiov.iov, when the write request call back,

s/alloc/allocates/
s/call back/calls back/

> 
> 
> 
> but in the function mirror_iteration_done(), it only free the op, not free the op->qiov.iov, so this cause memory leak.

s/free/frees/
s/cause/causes/

> 
> 
> 
> Signed-off-by: Zhang Min <rudy.zhangmin@huawei.com<mailto:rudy.zhangmin@huawei.com>>

Unnecessary <mailto:> notation here.

> 
> ---
> 
> block/mirror.c |    1 +
> 
> 1 files changed, 1 insertions(+), 0 deletions(-)
> 
> 
> 
> diff --git a/block/mirror.c b/block/mirror.c index 2932bab..9840840 100644
> 
> --- a/block/mirror.c
> 
> +++ b/block/mirror.c
> 
> @@ -96,6 +96,7 @@ static void mirror_iteration_done(MirrorOp *op, int ret)
> 
>          bitmap_set(s->cow_bitmap, chunk_num, nb_chunks);
> 
>      }
> 
> 
> 
> +    g_free(op->qiov.iov);
> 
>      g_slice_free(MirrorOp, op);
> 
>      qemu_coroutine_enter(s->common.co, NULL);  }
> 
> --
> 
> 

  reply	other threads:[~2014-01-22  3:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-21 11:43 [Qemu-devel] [PATCH] drive-mirror: fix memory leak Chentao (Boby)
2014-01-22  3:41 ` Fam Zheng [this message]
2014-01-22  6:53   ` Zhang Min
  -- strict thread matches above, loose matches on Subject: below --
2014-01-22  7:56 [Qemu-devel] [PATCH] drive-mirror:fix " Zhang Min
2014-01-22  8:27 ` Fam Zheng
2014-01-22  9:42 ` 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=20140122034143.GA24497@T430.redhat.com \
    --to=famz@redhat.com \
    --cc=boby.chen@huawei.com \
    --cc=kathy.wangting@huawei.com \
    --cc=mail.qinling@huawei.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rudy.zhangmin@huawei.com \
    --cc=wu.wubin@huawei.com \
    /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).