usb: dwc2: host: spinlock urb_enqueue
authorGregory Herrero <gregory.herrero@intel.com>
Wed, 29 Apr 2015 20:09:15 +0000 (22:09 +0200)
committerFelipe Balbi <balbi@ti.com>
Wed, 29 Apr 2015 20:19:55 +0000 (15:19 -0500)
commit33ad261aa62be02f0cedeb4d5735cc726de84a3f
tree813c94cc9394145e309c77882c5f5427894da83b
parenta7714c1cb11dc3bb97a76d2bb0560415d155b1d5
usb: dwc2: host: spinlock urb_enqueue

During urb_enqueue, if the urb can't be queued to the endpoint,
the urb is freed without any spinlock protection.
This leads to memory corruption when concurrent urb_dequeue try to free
same urb->hcpriv.
Thus, ensure the whole urb_enqueue in spinlocked.

Acked-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Gregory Herrero <gregory.herrero@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/dwc2/hcd.c
drivers/usb/dwc2/hcd_queue.c