summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/usb/gadget/function/uvc_video.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/usb/gadget/function/uvc_video.c b/drivers/usb/gadget/function/uvc_video.c
index 7f18dc471be3..dd3241fc6939 100644
--- a/drivers/usb/gadget/function/uvc_video.c
+++ b/drivers/usb/gadget/function/uvc_video.c
@@ -469,13 +469,15 @@ uvc_video_complete(struct usb_ep *ep, struct usb_request *req)
* Put request back in req_free for it to be cleaned
* up later.
*/
- uvcg_queue_cancel(queue, 0);
list_add_tail(&to_queue->list, &video->req_free);
}
} else {
uvc_video_free_request(ureq, ep);
+ ret = 0;
}
spin_unlock_irqrestore(&video->req_lock, flags);
+ if (ret < 0)
+ uvcg_queue_cancel(queue, 0);
}
static int