mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-30 14:19:16 +00:00
dlm: fixed memory leaks after failed ls_remove_names allocation
commit b982896cdb
upstream.
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
6353c0a037
commit
03acbec28a
1 changed files with 1 additions and 1 deletions
|
@ -680,11 +680,11 @@ static int new_lockspace(const char *name, const char *cluster,
|
|||
kfree(ls->ls_recover_buf);
|
||||
out_lkbidr:
|
||||
idr_destroy(&ls->ls_lkbidr);
|
||||
out_rsbtbl:
|
||||
for (i = 0; i < DLM_REMOVE_NAMES_MAX; i++) {
|
||||
if (ls->ls_remove_names[i])
|
||||
kfree(ls->ls_remove_names[i]);
|
||||
}
|
||||
out_rsbtbl:
|
||||
vfree(ls->ls_rsbtbl);
|
||||
out_lsfree:
|
||||
if (do_unreg)
|
||||
|
|
Loading…
Reference in a new issue