summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorGuozhonghua <guozhonghua@h3c.com>2016-10-11 23:51:01 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2016-10-12 01:06:30 +0300
commit0cc482ee41d609811bd7b91abdbcd1c5dbdfb783 (patch)
treebcb892bb46b17613ebe6c8fa46a450b45ad3e830 /fs
parent1689c73a739d094b544c680b0dfdebe52ffee8fb (diff)
downloadlinux-0cc482ee41d609811bd7b91abdbcd1c5dbdfb783.tar.xz
ocfs2: fix memory leak in dlm_migrate_request_handler()
In the dlm_migrate_request_handler(), when `ret' is -EEXIST, the mle should be freed, otherwise the memory will be leaked. Link: http://lkml.kernel.org/r/71604351584F6A4EBAE558C676F37CA4A3D3522A@H3CMLB12-EX.srv.huawei-3com.com Signed-off-by: Guozhonghua <guozhonghua@h3c.com> Reviewed-by: Mark Fasheh <mfasheh@versity.com> Cc: Eric Ren <zren@suse.com> Cc: Joel Becker <jlbec@evilplan.org> Cc: Junxiao Bi <junxiao.bi@oracle.com> Cc: Joseph Qi <joseph.qi@huawei.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/ocfs2/dlm/dlmmaster.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/ocfs2/dlm/dlmmaster.c b/fs/ocfs2/dlm/dlmmaster.c
index 6ea06f8a7d29..3f828a187049 100644
--- a/fs/ocfs2/dlm/dlmmaster.c
+++ b/fs/ocfs2/dlm/dlmmaster.c
@@ -3188,6 +3188,9 @@ int dlm_migrate_request_handler(struct o2net_msg *msg, u32 len, void *data,
migrate->new_master,
migrate->master);
+ if (ret < 0)
+ kmem_cache_free(dlm_mle_cache, mle);
+
spin_unlock(&dlm->master_lock);
unlock:
spin_unlock(&dlm->spinlock);