usb: gadget: f_cdev: Fix memory leak with func_name
func_name related memory is allocated on creating instance of driver with cser_set_inst_name() API with usage of kstrndup(). If cser_set_inst_name() returns non-zero value or driver instance is released, this func_name related memory is not freed. Fix this memory leak by freeing func_name from cser_free_inst() API. CRs-Fixed: 1070060 Change-Id: I7ba4c5a65bb01d056b4d2690fe30f7cbe47ba311 Signed-off-by: Mayank Rana <mrana@codeaurora.org>
This commit is contained in:
parent
9e2d528dc4
commit
f1288259bf
1 changed files with 1 additions and 0 deletions
|
@ -823,6 +823,7 @@ static void cser_free_inst(struct usb_function_instance *fi)
|
|||
device_destroy(fcdev_classp, MKDEV(major, opts->port->minor));
|
||||
cdev_del(&opts->port->fcdev_cdev);
|
||||
usb_cser_chardev_deinit();
|
||||
kfree(opts->func_name);
|
||||
kfree(opts->port);
|
||||
kfree(opts);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue