Skip to content

Commit b982896

Browse files
vaverinteigland
authored andcommitted
dlm: fixed memory leaks after failed ls_remove_names allocation
If allocation fails on last elements of array need to free already allocated elements. v2: just move existing out_rsbtbl label to right place Fixes 789924ba635f ("dlm: fix race between remove and lookup") Cc: stable@kernel.org # 3.6 Signed-off-by: Vasily Averin <vvs@virtuozzo.com> Signed-off-by: David Teigland <teigland@redhat.com>
1 parent 58a923a commit b982896

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎fs/dlm/lockspace.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -680,11 +680,11 @@ static int new_lockspace(const char *name, const char *cluster,
680680
kfree(ls->ls_recover_buf);
681681
out_lkbidr:
682682
idr_destroy(&ls->ls_lkbidr);
683+
out_rsbtbl:
683684
for (i = 0; i < DLM_REMOVE_NAMES_MAX; i++) {
684685
if (ls->ls_remove_names[i])
685686
kfree(ls->ls_remove_names[i]);
686687
}
687-
out_rsbtbl:
688688
vfree(ls->ls_rsbtbl);
689689
out_lsfree:
690690
if (do_unreg)

0 commit comments

Comments
 (0)