From: Li Jun Date: Tue, 15 Jul 2014 14:07:40 +0000 (+0800) Subject: usb: gadget: composite: dequeue cdev->req before free it in composite_dev_cleanup X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=f2267089ea17fa97b796b1b4247e3f8957655df3;p=linux-beck.git usb: gadget: composite: dequeue cdev->req before free it in composite_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 Signed-off-by: Felipe Balbi --- diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c index f80151932053..6935a822ce2b 100644 --- a/drivers/usb/gadget/composite.c +++ b/drivers/usb/gadget/composite.c @@ -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;