usb: gadget: f_fs: Fix memory leak for ipc_log_context
Driver is not calling ipc_log_context_destroy in driver cleanup which leaves the context allocated. Change-Id: Ic1a74b530836d142c9f1db2143b5700e8b6c3321 Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
This commit is contained in:
parent
3bf75ddd22
commit
ab8f94b1da
1 changed files with 7 additions and 0 deletions
|
@ -1581,6 +1581,8 @@ static int functionfs_init(void)
|
||||||
pr_err("failed registering file system (%d)\n", ret);
|
pr_err("failed registering file system (%d)\n", ret);
|
||||||
|
|
||||||
ffs_ipc_log = ipc_log_context_create(NUM_PAGES, "f_fs", 0);
|
ffs_ipc_log = ipc_log_context_create(NUM_PAGES, "f_fs", 0);
|
||||||
|
if (IS_ERR_OR_NULL(ffs_ipc_log))
|
||||||
|
ffs_ipc_log = NULL;
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -1591,6 +1593,11 @@ static void functionfs_cleanup(void)
|
||||||
|
|
||||||
pr_info("unloading\n");
|
pr_info("unloading\n");
|
||||||
unregister_filesystem(&ffs_fs_type);
|
unregister_filesystem(&ffs_fs_type);
|
||||||
|
|
||||||
|
if (ffs_ipc_log) {
|
||||||
|
ipc_log_context_destroy(ffs_ipc_log);
|
||||||
|
ffs_ipc_log = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue