OSDN Git Service

dlm: fixed memory leaks after failed ls_remove_names allocation
authorVasily Averin <vvs@virtuozzo.com>
Thu, 15 Nov 2018 10:15:05 +0000 (13:15 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 13 Jan 2019 09:05:33 +0000 (10:05 +0100)
commita09b8db22851526c3607dc4d48c22bf9a444ae98
tree4d25b62a6171a16755aebe5529b59bdaf8460d65
parent11e047131fff3966f4b6c6929d14a378c5e916d1
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