summaryrefslogtreecommitdiffstats
path: root/fs/dlm
diff options
context:
space:
mode:
authorVasily Averin2018-11-15 11:15:05 +0100
committerGreg Kroah-Hartman2019-01-13 09:51:07 +0100
commit03acbec28a24fd961b0e78904d5644a30bb5cfc5 (patch)
treed8d02ea32563b51e121230175d4fea95da94f057 /fs/dlm
parentblock: mq-deadline: Fix write completion handling (diff)
downloadkernel-qcow2-linux-03acbec28a24fd961b0e78904d5644a30bb5cfc5.tar.gz
kernel-qcow2-linux-03acbec28a24fd961b0e78904d5644a30bb5cfc5.tar.xz
kernel-qcow2-linux-03acbec28a24fd961b0e78904d5644a30bb5cfc5.zip
dlm: fixed memory leaks after failed ls_remove_names allocation
commit b982896cdb6e6a6b89d86dfb39df489d9df51e14 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>
Diffstat (limited to 'fs/dlm')
-rw-r--r--fs/dlm/lockspace.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/dlm/lockspace.c b/fs/dlm/lockspace.c
index 5ba94be006ee..6a1529e478f3 100644
--- a/fs/dlm/lockspace.c
+++ b/fs/dlm/lockspace.c
@@ -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)