summaryrefslogtreecommitdiffstats
path: root/fs/dlm
diff options
context:
space:
mode:
authorTycho Andersen <tycho@tycho.ws>2018-11-02 21:18:20 +0100
committerDavid Teigland <teigland@redhat.com>2018-11-07 22:50:34 +0100
commitd968b4e240cfe39d39d80483bac8bca8716fd93c (patch)
tree371fb1d26f628470d1e8697b276941f2470ef473 /fs/dlm
parentLinux 4.20-rc1 (diff)
downloadlinux-d968b4e240cfe39d39d80483bac8bca8716fd93c.tar.xz
linux-d968b4e240cfe39d39d80483bac8bca8716fd93c.zip
dlm: fix invalid free
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>
Diffstat (limited to 'fs/dlm')
-rw-r--r--fs/dlm/member.c5
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;
}