From d8ee7299b5ac5172c40c3dca5c1842d875987b30 Mon Sep 17 00:00:00 2001 From: Iliyan Malchev Date: Fri, 18 Feb 2011 11:28:32 -0800 Subject: [PATCH] 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 --- drivers/usb/gadget/f_adb.c | 1 + 1 file changed, 1 insertion(+) 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) { -- 2.7.4