mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 04:10:18 +09:00
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>
This commit is contained in:
committed by
Colin Cross
parent
1adbbfbe99
commit
43f3dc8f5c
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user