dm log userspace: fix memory leak in dm_ulog_tfr_init failure path
authorAlexey Khoroshilov <khoroshilov@ispras.ru>
Wed, 1 Oct 2014 20:58:35 +0000 (22:58 +0200)
committerZefan Li <lizefan@huawei.com>
Mon, 2 Feb 2015 09:04:47 +0000 (17:04 +0800)
commitdbd43539a8faff93490475bccbf9e4d0b7ebc2cb
treeee871c4a43ad02fe1decc1a07469e409387b24bb
parentadcbd2e571ae7b295c25065b55af6550659bd483
dm log userspace: fix memory leak in dm_ulog_tfr_init failure path

commit 56ec16cb1e1ce46354de8511eef962a417c32c92 upstream.

If cn_add_callback() fails in dm_ulog_tfr_init(), it does not
deallocate prealloced memory but calls cn_del_callback().

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Reviewed-by: Jonathan Brassow <jbrassow@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Zefan Li <lizefan@huawei.com>
drivers/md/dm-log-userspace-transfer.c