mirror of
https://github.com/torvalds/linux.git
synced 2026-06-08 14:42:37 +02:00
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>
This commit is contained in:
parent
090cbc41c9
commit
7d5250301d
|
|
@ -321,6 +321,7 @@ static ssize_t adb_read(struct file *fp, char __user *buf,
|
|||
if (ret < 0) {
|
||||
dev->error = 1;
|
||||
r = ret;
|
||||
usb_ep_dequeue(dev->ep_out, req);
|
||||
goto done;
|
||||
}
|
||||
if (!dev->error) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user