diff options
author | Mike Lockwood <lockwood@android.com> | 2011-02-19 15:33:17 -0500 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2011-06-14 09:09:55 -0700 |
commit | 43f3dc8f5cab19d2baeb3d8d4d6fc01e2d19c337 (patch) | |
tree | 72b6ae884bf2057c65f7aedd81abd6882a666a32 /drivers/usb | |
parent | 1adbbfbe99343cb7735ddf072e0e70095b6facc5 (diff) |
USB: gadget: f_mtp: dequeue request on error in mtp_read
In mtp_read(), if wait_event_interruptible() returns an error, we need to
remove the request from the EP queue. Else, on the next call to mtp_read(), we
will attempt to enqueue the request again, potentially corrupting the
queue. This is what happens with musb_gadget_queue(), which does not check for
duplicate requests.
Based on a similar change to f_adb.c
Signed-off-by: Mike Lockwood <lockwood@android.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/gadget/f_mtp.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/usb/gadget/f_mtp.c b/drivers/usb/gadget/f_mtp.c index 8128b203e76..92dd89b340b 100644 --- a/drivers/usb/gadget/f_mtp.c +++ b/drivers/usb/gadget/f_mtp.c @@ -504,6 +504,7 @@ requeue_req: ret = wait_event_interruptible(dev->read_wq, dev->rx_done); if (ret < 0) { r = ret; + usb_ep_dequeue(dev->ep_out, req); goto done; } if (dev->state == STATE_BUSY) { |