Browse files

Fix musb crash on resume that is caused by adb

The adb driver enqueues the same reuest during read hoping that
by the time it is doing next queue, the previous one completed.
But if there was a signal (like what happens on suspend) this is not true
and we need to dequeue the request first before bailing out.
  • Loading branch information...
verygreen committed May 13, 2011
1 parent 66b694f commit 026f37997e769773fe437ced637e28e725711a3c
Showing with 4 additions and 0 deletions.
  1. +4 −0 drivers/usb/gadget/f_adb.c
@@ -319,6 +319,10 @@ static ssize_t adb_read(struct file *fp, char __user *buf,
/* wait for a request to complete */
ret = wait_event_interruptible(dev->read_wq, dev->rx_done);
if (ret < 0) {
+ while (!dev->rx_done) {
+ usb_ep_dequeue(dev->ep_out, req);
+ schedule();
+ }
dev->error = 1;
r = ret;
goto done;

0 comments on commit 026f379

Please sign in to comment.