diff options
author | yuzheng ma <myz147@gmail.com> | 2012-08-15 08:11:40 (GMT) |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2012-09-06 16:52:26 (GMT) |
commit | 3067779b1566ae5fb6af40f03ae874ac47035523 (patch) | |
tree | 3de04dd718271471313e05354eac4febdf476888 /drivers | |
parent | 3b9c1c5ba7a95caae8440ea47308496b14f7301a (diff) | |
download | linux-fsl-qoriq-3067779b1566ae5fb6af40f03ae874ac47035523.tar.xz |
usb: musb: host: fix for musb_start_urb Oops
when using musb_urb_enqueue to submit three urbs to the same endpoint, when
hep->hcpriv is NULL, qh will be allocated when the first urb is completed.
When the IRQ completes the next two urbs, qh->hep->hcpriv will be set to NULL.
Now the second urb get musb->lock and executes musb_schedule(), but
next_urb(qh) is NULL, so musb_start_urb will Oops.
[ balbi@ti.com : practically rewrote commit log so it makes sense ]
Signed-off-by: mayuzheng <myz147@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/musb/musb_host.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c index 4bb717d..1ae378d 100644 --- a/drivers/usb/musb/musb_host.c +++ b/drivers/usb/musb/musb_host.c @@ -2049,7 +2049,7 @@ static int musb_urb_enqueue( * we only have work to do in the former case. */ spin_lock_irqsave(&musb->lock, flags); - if (hep->hcpriv) { + if (hep->hcpriv || !next_urb(qh)) { /* some concurrent activity submitted another urb to hep... * odd, rare, error prone, but legal. */ |