Merge "usb: gadget: f_cdev: Fix NULL pointer dereference in cser_free_inst"

This commit is contained in:
Linux Build Service Account 2017-05-16 16:08:15 -07:00 committed by Gerrit - the friendly Code Review server
commit d573c819ea

View file

@ -823,8 +823,10 @@ static void cser_free_inst(struct usb_function_instance *fi)
opts = container_of(fi, struct f_cdev_opts, func_inst);
device_destroy(fcdev_classp, MKDEV(major, opts->port->minor));
cdev_del(&opts->port->fcdev_cdev);
if (opts->port) {
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);