diff options
author | Alexey Khoroshilov <khoroshilov@ispras.ru> | 2014-10-01 22:58:35 +0200 |
---|---|---|
committer | Jiri Slaby <jslaby@suse.cz> | 2014-11-13 19:02:22 +0100 |
commit | 93232824e2c3aa8173a1060fbf9acea7f477d53c (patch) | |
tree | 55358a8aa8de56a6d7905edf125e5f0863a7210f /drivers/md/dm-log-userspace-transfer.c | |
parent | 40e8412c09dbb9a60aaba93a91c4d56e88caa9c8 (diff) | |
download | lwn-93232824e2c3aa8173a1060fbf9acea7f477d53c.tar.gz lwn-93232824e2c3aa8173a1060fbf9acea7f477d53c.zip |
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: Jiri Slaby <jslaby@suse.cz>
Diffstat (limited to 'drivers/md/dm-log-userspace-transfer.c')
-rw-r--r-- | drivers/md/dm-log-userspace-transfer.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/dm-log-userspace-transfer.c b/drivers/md/dm-log-userspace-transfer.c index 08d9a207259a..c69d0b787746 100644 --- a/drivers/md/dm-log-userspace-transfer.c +++ b/drivers/md/dm-log-userspace-transfer.c @@ -272,7 +272,7 @@ int dm_ulog_tfr_init(void) r = cn_add_callback(&ulog_cn_id, "dmlogusr", cn_ulog_callback); if (r) { - cn_del_callback(&ulog_cn_id); + kfree(prealloced_cn_msg); return r; } |