Skip to content

Commit

Permalink
usb: gadget: function: uvc: conditionally dequeue
Browse files Browse the repository at this point in the history
We shouldn't try to dequeue a NULL pointer.

Signed-off-by: Felipe Balbi <balbi@ti.com>
  • Loading branch information
Felipe Balbi committed Oct 20, 2014
1 parent 7a60855 commit d7577b3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/usb/gadget/function/uvc_video.c
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,8 @@ int uvcg_video_enable(struct uvc_video *video, int enable)

if (!enable) {
for (i = 0; i < UVC_NUM_REQUESTS; ++i)
usb_ep_dequeue(video->ep, video->req[i]);
if (video->req[i])
usb_ep_dequeue(video->ep, video->req[i]);

uvc_video_free_requests(video);
uvcg_queue_enable(&video->queue, 0);
Expand Down

0 comments on commit d7577b3

Please sign in to comment.