mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
dm log userspace: fix memory leak in dm_ulog_tfr_init failure path
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]> Cc: [email protected]
This commit is contained in:
parent
0e825862f3
commit
56ec16cb1e
1 changed files with 1 additions and 1 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue