提交 b4e5a120 编写于 作者: T Tycho Andersen 提交者: Xie XiuQi

dlm: fix invalid free

[ Upstream commit d968b4e240cfe39d39d80483bac8bca8716fd93c ]

dlm_config_nodes() does not allocate nodes on failure, so we should not
free() nodes when it fails.
Signed-off-by: NTycho Andersen <tycho@tycho.ws>
Signed-off-by: NDavid Teigland <teigland@redhat.com>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 fbba58e3
...@@ -680,7 +680,7 @@ int dlm_ls_start(struct dlm_ls *ls) ...@@ -680,7 +680,7 @@ int dlm_ls_start(struct dlm_ls *ls)
error = dlm_config_nodes(ls->ls_name, &nodes, &count); error = dlm_config_nodes(ls->ls_name, &nodes, &count);
if (error < 0) if (error < 0)
goto fail; goto fail_rv;
spin_lock(&ls->ls_recover_lock); spin_lock(&ls->ls_recover_lock);
...@@ -712,8 +712,9 @@ int dlm_ls_start(struct dlm_ls *ls) ...@@ -712,8 +712,9 @@ int dlm_ls_start(struct dlm_ls *ls)
return 0; return 0;
fail: fail:
kfree(rv);
kfree(nodes); kfree(nodes);
fail_rv:
kfree(rv);
return error; return error;
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册