Linux ocfs2 filesystem development
 help / color / mirror / Atom feed
From: Younger Liu <younger.liu@huawei.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH] ocfs2: free path in ocfs2_remove_inode_range()
Date: Fri, 2 Aug 2013 17:14:30 +0800	[thread overview]
Message-ID: <51FB7876.1010506@huawei.com> (raw)

In ocfs2_remove_inode_range(), there is a memory leak.
The variable path has allocated memory with ocfs2_new_path_from_et(), 
but it is not free.

Signed-off-by: Younger Liu <younger.liu@huawei.com>
---
 fs/ocfs2/file.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c
index 833a09b..2d1a227 100644
--- a/fs/ocfs2/file.c
+++ b/fs/ocfs2/file.c
@@ -1796,6 +1796,7 @@ static int ocfs2_remove_inode_range(struct inode *inode,
 	ocfs2_truncate_cluster_pages(inode, byte_start, byte_len);
 
 out:
+	ocfs2_free_path(path);
 	ocfs2_schedule_truncate_log_flush(osb, 1);
 	ocfs2_run_deallocs(osb, &dealloc);
 
-- 
1.7.9.7

             reply	other threads:[~2013-08-02  9:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-02  9:14 Younger Liu [this message]
2013-08-06  6:23 ` [Ocfs2-devel] [PATCH] ocfs2: free path in ocfs2_remove_inode_range() Jeff Liu

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=51FB7876.1010506@huawei.com \
    --to=younger.liu@huawei.com \
    --cc=ocfs2-devel@oss.oracle.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