提交 bf17eba7 编写于 作者: F Felipe Balbi 提交者: Greg Kroah-Hartman

Revert "usb: gadget: composite: dequeue cdev->req before free it in composite_dev_cleanup"

This reverts commit f2267089.

That commit causes more problem than fixes. Firstly, kfree()
should be called after usb_ep_dequeue() and secondly, the way
things are, we will try to dequeue a request that has already
completed much more frequently than one which is pending.

Cc: Li Jun <b47624@freescale.com>
Signed-off-by: NFelipe Balbi <balbi@ti.com>
Cc: stable <stable@vger.kernel.org> # 3.17
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 6ca01a1b
...@@ -1956,7 +1956,6 @@ void composite_dev_cleanup(struct usb_composite_dev *cdev) ...@@ -1956,7 +1956,6 @@ void composite_dev_cleanup(struct usb_composite_dev *cdev)
} }
if (cdev->req) { if (cdev->req) {
kfree(cdev->req->buf); kfree(cdev->req->buf);
usb_ep_dequeue(cdev->gadget->ep0, cdev->req);
usb_ep_free_request(cdev->gadget->ep0, cdev->req); usb_ep_free_request(cdev->gadget->ep0, cdev->req);
} }
cdev->next_string_id = 0; cdev->next_string_id = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册