USB: gadget: f_mtp: dequeue request on error in mtp_read
authorMike Lockwood <lockwood@android.com>
Sat, 19 Feb 2011 20:33:17 +0000 (15:33 -0500)
committerColin Cross <ccross@android.com>
Tue, 14 Jun 2011 16:09:55 +0000 (09:09 -0700)
commit43f3dc8f5cab19d2baeb3d8d4d6fc01e2d19c337
tree72b6ae884bf2057c65f7aedd81abd6882a666a32
parent1adbbfbe99343cb7735ddf072e0e70095b6facc5
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>
drivers/usb/gadget/f_mtp.c