]> git.baikalelectronics.ru Git - kernel.git/commit
usb: gadget: composite: dequeue cdev->req before free its buffer
authorLi Jun <B47624@freescale.com>
Thu, 28 Aug 2014 13:44:11 +0000 (21:44 +0800)
committerFelipe Balbi <balbi@ti.com>
Tue, 2 Sep 2014 14:16:45 +0000 (09:16 -0500)
commit1837de74bbbabcaad873fab6a33940ad77178084
treeca28abb67c063045c767e0ab385043e5f803754d
parent039214963abe528c924d4f741ef92f1df5addfdd
usb: gadget: composite: dequeue cdev->req before free its buffer

commit c6876fd(usb: gadget: composite: dequeue cdev->req before free it in
composite_dev_cleanup) fixed a bug: free the usb request(i.e. cdev->req) but
does not dequeue it beforehand. This fix is not proper enough because it
dequeues the request after free its data buffer, considering the hardware can
access the buffer's memory anytime before the request's complettion rountine
runs, and usb_ep_dequeue always call the complettion rountine before it returns,
so the best way is to dequeue the request before free its buffer.

Suggested-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Li Jun <b47624@freescale.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/gadget/composite.c