From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:37458) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QIo5t-0005El-46 for qemu-devel@nongnu.org; Sat, 07 May 2011 16:27:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QIo5r-0004cY-PJ for qemu-devel@nongnu.org; Sat, 07 May 2011 16:27:17 -0400 Received: from mail-vx0-f173.google.com ([209.85.220.173]:47539) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QIo5r-0004cU-Gx for qemu-devel@nongnu.org; Sat, 07 May 2011 16:27:15 -0400 Received: by vxb37 with SMTP id 37so5311144vxb.4 for ; Sat, 07 May 2011 13:27:14 -0700 (PDT) MIME-Version: 1.0 Sender: pedrinho.rep51@gmail.com In-Reply-To: <4DC50954.4060601@mail.berlios.de> References: <1304708747-3692-1-git-send-email-pedro.scarapiccha@br.flextronics.com> <4DC50954.4060601@mail.berlios.de> Date: Sat, 7 May 2011 17:27:14 -0300 Message-ID: From: Pedro Scarapicchia Junior Content-Type: multipart/alternative; boundary=90e6ba4fc1c88c1ab504a2b56e6d Subject: Re: [Qemu-devel] [PATCH] virtio-9p: Fix a memory leak List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Weil Cc: Stefan Hajnoczi , Pedro Scarapicchia Junior , "Venkateswararao Jujjuri (JV)" , qemu-devel@nongnu.org --90e6ba4fc1c88c1ab504a2b56e6d Content-Type: text/plain; charset=ISO-8859-1 Hi Stefan, Thanks for the comment. I believe that it is possible to release the memory at v9fs_walk. However v9fs_walk_complete() is called from two another functions: v9fs_walk_post_newfid_lstat() and v9fs_walk_post_oldfid_lstat(). Placing qemu_free at end of v9fs_walk_complete() solve memory leak in both cases. Venkateswararao, what's your opinion? Best regards, Pedro On Sat, May 7, 2011 at 5:56 AM, Stefan Weil wrote: > Am 07.05.2011 10:34, schrieb Stefan Hajnoczi: > > On Fri, May 6, 2011 at 8:05 PM, Pedro Scarapicchia Junior >> wrote: >> >>> At v9fs_walk_complete(), the memory allocated at v9fs_walk() is not being >>> released leading system to crash due out of memory. >>> >>> This patch releases structure V9fsWalkState after v9fs_walk is complete. >>> >>> Signed-off-by: Pedro Scarapicchia Junior < >>> pedro.scarapiccha@br.flextronics.com> >>> --- >>> hw/9pfs/virtio-9p.c | 2 ++ >>> 1 files changed, 2 insertions(+), 0 deletions(-) >>> >> >> Thanks for this patch. I suggest CCing Venkateswararao Jujjuri (JV) >> , the virtio-9p maintainer (see MAINTAINERS >> file), on future patches so he can pick them up quickly. >> >> Stefan >> > > Releasing the memory in v9fs_walk() were it was allocated > would be cleaner and easier to review. Is this not possible? > > Stefan W. > > > --90e6ba4fc1c88c1ab504a2b56e6d Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi Stefan,

Thanks for the comment.

<= div>I believe that it is possible to release the memory at v9fs_walk. Howev= er v9fs_walk_complete() is called from two another functions:=A0v9fs_walk_p= ost_newfid_lstat()=A0=A0and=A0=A0v9fs_walk_post_oldfid_lstat(). Placing qemu_= free at end of=A0v9fs_walk_complete() solve memory leak in both cases.

Venkateswararao, what's your opinion?
Best regards,

Pedro=A0

On Sat, May 7, 2011 at 5:56 AM, Stefan Weil <weil@mail.berlios.de&= gt; wrote:
Am 07.05.2011 10:34, schrieb Stefan Hajnocz= i:

On Fri, May 6, 2011 at 8:05 PM, Pedro Scarapicchia Junior
<pedrinho.= rep51@gmail.com> wrote:
At v9fs_walk_complete(), the memory allocated at v9fs_walk() is not being released leading system to crash due out of memory.

This patch releases structure V9fsWalkState after v9fs_walk is complete.
Signed-off-by: Pedro Scarapicchia Junior <pedro.scarapiccha@br.flextronic= s.com>
---
=A0hw/9pfs/virtio-9p.c | =A0 =A02 ++
=A01 files changed, 2 insertions(+), 0 deletions(-)

Thanks for this patch. I suggest CCing Venkateswararao Jujjuri (JV)
<jvrao@lin= ux.vnet.ibm.com>, the virtio-9p maintainer (see MAINTAINERS
file), on future patches so he can pick them up quickly.

Stefan

Releasing the memory in v9fs_walk() were it was allocated
would be cleaner and easier to review. Is this not possible?

Stefan W.



--90e6ba4fc1c88c1ab504a2b56e6d--