Merge "usb: gadget: f_cdev: Fix NULL pointer dereference in cser_free_inst"
This commit is contained in:
commit
d573c819ea
1 changed files with 4 additions and 2 deletions
|
@ -823,8 +823,10 @@ static void cser_free_inst(struct usb_function_instance *fi)
|
||||||
|
|
||||||
opts = container_of(fi, struct f_cdev_opts, func_inst);
|
opts = container_of(fi, struct f_cdev_opts, func_inst);
|
||||||
|
|
||||||
device_destroy(fcdev_classp, MKDEV(major, opts->port->minor));
|
if (opts->port) {
|
||||||
cdev_del(&opts->port->fcdev_cdev);
|
device_destroy(fcdev_classp, MKDEV(major, opts->port->minor));
|
||||||
|
cdev_del(&opts->port->fcdev_cdev);
|
||||||
|
}
|
||||||
usb_cser_chardev_deinit();
|
usb_cser_chardev_deinit();
|
||||||
kfree(opts->func_name);
|
kfree(opts->func_name);
|
||||||
kfree(opts->port);
|
kfree(opts->port);
|
||||||
|
|
Loading…
Add table
Reference in a new issue