Skip to content

Commit

Permalink
dlm: fix invalid free
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Tycho Andersen authored and David Teigland committed Nov 7, 2018
1 parent 6510223 commit d968b4e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions fs/dlm/member.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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;
}

0 comments on commit d968b4e

Please sign in to comment.