Skip to content

Commit d968b4e

Browse files
tych0teigland
authored andcommitted
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>
1 parent 6510223 commit d968b4e

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎fs/dlm/member.c‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,7 @@ int dlm_ls_start(struct dlm_ls *ls)
680680

681681
error = dlm_config_nodes(ls->ls_name, &nodes, &count);
682682
if (error < 0)
683-
goto fail;
683+
goto fail_rv;
684684

685685
spin_lock(&ls->ls_recover_lock);
686686

@@ -712,8 +712,9 @@ int dlm_ls_start(struct dlm_ls *ls)
712712
return 0;
713713

714714
fail:
715-
kfree(rv);
716715
kfree(nodes);
716+
fail_rv:
717+
kfree(rv);
717718
return error;
718719
}
719720

0 commit comments

Comments
 (0)