summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpiaojun <piaojun@huawei.com>2017-07-06 15:36:13 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2017-07-06 16:24:30 -0700
commit25b1c72e15b89bfcdcce11c5f61d729d87afe8c5 (patch)
tree387cac1376535b3aa8ec590e8390209a82b67f27
parent62aa81d7c4c24b90fdb61da70ac0dbbc414f9939 (diff)
downloadlinux-25b1c72e15b89bfcdcce11c5f61d729d87afe8c5.tar.gz
linux-25b1c72e15b89bfcdcce11c5f61d729d87afe8c5.tar.bz2
linux-25b1c72e15b89bfcdcce11c5f61d729d87afe8c5.zip
ocfs2: free 'dummy_sc' in sc_fop_release() to prevent memory leak
'sd->dbg_sock' is malloced in sc_common_open(), but not freed at the end of sc_fop_release(). Link: http://lkml.kernel.org/r/594FB0A4.2050105@huawei.com Signed-off-by: Jun Piao <piaojun@huawei.com> Reviewed-by: Joseph Qi <jiangqi903@gmail.com> Cc: Mark Fasheh <mfasheh@versity.com> Cc: Joel Becker <jlbec@evilplan.org> Cc: Junxiao Bi <junxiao.bi@oracle.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--fs/ocfs2/cluster/netdebug.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/ocfs2/cluster/netdebug.c b/fs/ocfs2/cluster/netdebug.c
index 564c504d6efd..74a21f6695c8 100644
--- a/fs/ocfs2/cluster/netdebug.c
+++ b/fs/ocfs2/cluster/netdebug.c
@@ -426,6 +426,7 @@ static int sc_fop_release(struct inode *inode, struct file *file)
struct o2net_sock_container *dummy_sc = sd->dbg_sock;
o2net_debug_del_sc(dummy_sc);
+ kfree(dummy_sc);
return seq_release_private(inode, file);
}