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>
This commit is contained in:
parent
651022382c
commit
d968b4e240
|
@ -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)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
kfree(rv);
|
|
||||||
kfree(nodes);
|
kfree(nodes);
|
||||||
|
fail_rv:
|
||||||
|
kfree(rv);
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue