提交 0cc482ee 编写于 作者: G Guozhonghua 提交者: Linus Torvalds

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.comSigned-off-by: NGuozhonghua <guozhonghua@h3c.com>
Reviewed-by: NMark 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: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 1689c73a
...@@ -3188,6 +3188,9 @@ int dlm_migrate_request_handler(struct o2net_msg *msg, u32 len, void *data, ...@@ -3188,6 +3188,9 @@ int dlm_migrate_request_handler(struct o2net_msg *msg, u32 len, void *data,
migrate->new_master, migrate->new_master,
migrate->master); migrate->master);
if (ret < 0)
kmem_cache_free(dlm_mle_cache, mle);
spin_unlock(&dlm->master_lock); spin_unlock(&dlm->master_lock);
unlock: unlock:
spin_unlock(&dlm->spinlock); spin_unlock(&dlm->spinlock);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册