Skip to content
This repository has been archived by the owner on Jul 23, 2023. It is now read-only.

Commit

Permalink
dm log userspace: fix memory leak in dm_ulog_tfr_init failure path
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Jonathan Brassow <[email protected]>
Signed-off-by: Mike Snitzer <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
khoroshilov authored and delaanthonio committed Aug 13, 2015
1 parent e6f269b commit c79b45c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/md/dm-log-userspace-transfer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit c79b45c

Please sign in to comment.