diff options
author | Tycho Andersen <tycho@tycho.ws> | 2018-11-02 23:18:20 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-12-01 11:14:11 +0300 |
commit | eabc0324f896bfaec98bf749c88753f5dfa2fed8 (patch) | |
tree | 27a5246abc06e518f36a7949d8344d5a10f53114 /fs/dlm | |
parent | 275cda44213c75f5830dc8fc667923aac04dd410 (diff) | |
download | linux-eabc0324f896bfaec98bf749c88753f5dfa2fed8.tar.xz |
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: Tycho Andersen <tycho@tycho.ws>
Signed-off-by: David Teigland <teigland@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'fs/dlm')
-rw-r--r-- | fs/dlm/member.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/dlm/member.c b/fs/dlm/member.c index 3fda3832cf6a..cad6d85911a8 100644 --- a/fs/dlm/member.c +++ b/fs/dlm/member.c @@ -680,7 +680,7 @@ int dlm_ls_start(struct dlm_ls *ls) error = dlm_config_nodes(ls->ls_name, &nodes, &count); if (error < 0) - goto fail; + goto fail_rv; spin_lock(&ls->ls_recover_lock); @@ -712,8 +712,9 @@ int dlm_ls_start(struct dlm_ls *ls) return 0; fail: - kfree(rv); kfree(nodes); + fail_rv: + kfree(rv); return error; } |