Skip to content

Commit

Permalink
usb: gadget: composite: dequeue cdev->req before free it in composite…
Browse files Browse the repository at this point in the history
…_dev_cleanup

This patch try to dequeue the cdev->req to guarantee the request is not queued
before free it.

Signed-off-by: Li Jun <b47624@freescale.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
  • Loading branch information
Li Jun authored and Felipe Balbi committed Jul 16, 2014
1 parent 371254c commit f226708
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/usb/gadget/composite.c
Original file line number Diff line number Diff line change
Expand Up @@ -1956,6 +1956,7 @@ void composite_dev_cleanup(struct usb_composite_dev *cdev)
}
if (cdev->req) {
kfree(cdev->req->buf);
usb_ep_dequeue(cdev->gadget->ep0, cdev->req);
usb_ep_free_request(cdev->gadget->ep0, cdev->req);
}
cdev->next_string_id = 0;
Expand Down

0 comments on commit f226708

Please sign in to comment.