qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] drive-mirror: fix memory leak


From: Fam Zheng
Subject: Re: [Qemu-devel] [PATCH] drive-mirror: fix memory leak
Date: Wed, 22 Jan 2014 11:41:43 +0800
User-agent: Mutt/1.5.22 (2013-10-16)

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 <address@hidden<mailto:address@hidden>>

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 via email to

[Prev in Thread] Current Thread [Next in Thread]