dlm: fixed memory leaks after failed ls_remove_names allocation
commit03acbec28a24fd961b0e78904d5644a30bb5cfc5
authorVasily Averin <vvs@virtuozzo.com>
Thu, 15 Nov 2018 10:15:05 +0000 (15 13:15 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 13 Jan 2019 08:51:07 +0000 (13 09:51 +0100)
treed8d02ea32563b51e121230175d4fea95da94f057
parent6353c0a03791c5d076d5edacfabc103cc51d879c
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>
fs/dlm/lockspace.c