ocfs2: free path in ocfs2_remove_inode_range()
authorYounger Liu <younger.liu@huawei.com>
Wed, 11 Sep 2013 21:19:59 +0000 (14:19 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 11 Sep 2013 22:56:50 +0000 (15:56 -0700)
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>
Reviewed-by: Jie Liu <jeff.liu@oracle.com>
Cc: Mark Fasheh <mfasheh@suse.com>
Cc: Joel Becker <jlbec@evilplan.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/ocfs2/file.c

index 409c549ae02aabe31cb3a81d0e8eeb9a364245b4..4f8197caa487f59c1868d4e292e254587a46eab1 100644 (file)
@@ -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);