diff options
author | Iliyan Malchev <malchev@google.com> | 2011-02-18 11:28:32 -0800 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2011-06-14 09:09:52 -0700 |
commit | 7d5250301dbedff486708e88fec0a4e5640d23b2 (patch) | |
tree | 94919d7cf441339f1f3aa9b05b6500d40870855e | |
parent | 090cbc41c937f03311d34b72ab435444ad752cb6 (diff) | |
download | kernel_samsung_tuna-7d5250301dbedff486708e88fec0a4e5640d23b2.zip kernel_samsung_tuna-7d5250301dbedff486708e88fec0a4e5640d23b2.tar.gz kernel_samsung_tuna-7d5250301dbedff486708e88fec0a4e5640d23b2.tar.bz2 |
USB: gadget: f_adb: dequeue request on error in adb_read
In adb_read(), if wait_event_interruptible() returns an error, we need to
remove the request from the EP queue. Else, on the next call to adb_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.
Signed-off-by: Iliyan Malchev <malchev@google.com>
-rw-r--r-- | drivers/usb/gadget/f_adb.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/usb/gadget/f_adb.c b/drivers/usb/gadget/f_adb.c index 0d25276..7cfa39c 100644 --- a/drivers/usb/gadget/f_adb.c +++ b/drivers/usb/gadget/f_adb.c @@ -321,6 +321,7 @@ requeue_req: if (ret < 0) { dev->error = 1; r = ret; + usb_ep_dequeue(dev->ep_out, req); goto done; } if (!dev->error) { |