diff options
author | Vasily Averin <vvs@virtuozzo.com> | 2018-11-15 13:15:05 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-01-13 12:05:33 +0300 |
commit | a09b8db22851526c3607dc4d48c22bf9a444ae98 (patch) | |
tree | 4d25b62a6171a16755aebe5529b59bdaf8460d65 /fs/dlm | |
parent | 11e047131fff3966f4b6c6929d14a378c5e916d1 (diff) | |
download | linux-a09b8db22851526c3607dc4d48c22bf9a444ae98.tar.xz |
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.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/dlm/lockspace.c b/fs/dlm/lockspace.c index f3e72787e7f9..30e4e01db35a 100644 --- a/fs/dlm/lockspace.c +++ b/fs/dlm/lockspace.c @@ -673,11 +673,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) |