Merge "usb: gadget: Fix double free of device descriptor pointers"
This commit is contained in:
commit
d07ffb8fe2
2 changed files with 5 additions and 7 deletions
|
@ -2843,16 +2843,13 @@ static void gsi_unbind(struct usb_configuration *c, struct usb_function *f)
|
|||
if (gsi->prot_id == IPA_USB_MBIM)
|
||||
mbim_gsi_ext_config_desc.function.subCompatibleID[0] = 0;
|
||||
|
||||
if (gadget_is_superspeed(c->cdev->gadget)) {
|
||||
if (gadget_is_superspeed(c->cdev->gadget))
|
||||
usb_free_descriptors(f->ss_descriptors);
|
||||
f->ss_descriptors = NULL;
|
||||
}
|
||||
if (gadget_is_dualspeed(c->cdev->gadget)) {
|
||||
|
||||
if (gadget_is_dualspeed(c->cdev->gadget))
|
||||
usb_free_descriptors(f->hs_descriptors);
|
||||
f->hs_descriptors = NULL;
|
||||
}
|
||||
|
||||
usb_free_descriptors(f->fs_descriptors);
|
||||
f->fs_descriptors = NULL;
|
||||
|
||||
if (gsi->c_port.notify) {
|
||||
kfree(gsi->c_port.notify_req->buf);
|
||||
|
|
|
@ -1456,6 +1456,7 @@ struct usb_descriptor_header **usb_copy_descriptors(
|
|||
static inline void usb_free_descriptors(struct usb_descriptor_header **v)
|
||||
{
|
||||
kfree(v);
|
||||
v = NULL;
|
||||
}
|
||||
|
||||
struct usb_function;
|
||||
|
|
Loading…
Add table
Reference in a new issue