forked from luck/tmp_suning_uos_patched
USB: gadget: Remove suspended sysfs file before freeing cdev
cdev struct is accessed in suspended sysfs show function. So remove sysfs file before freeing the cdev in composite_unbind. Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
f4ce908447
commit
daba58035a
@ -1047,9 +1047,9 @@ composite_unbind(struct usb_gadget *gadget)
|
||||
kfree(cdev->req->buf);
|
||||
usb_ep_free_request(gadget->ep0, cdev->req);
|
||||
}
|
||||
device_remove_file(&gadget->dev, &dev_attr_suspended);
|
||||
kfree(cdev);
|
||||
set_gadget_data(gadget, NULL);
|
||||
device_remove_file(&gadget->dev, &dev_attr_suspended);
|
||||
composite = NULL;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user