Skip to content

Commit

Permalink
[media] uvcvideo: Handle uvc_init_video() failure in uvc_video_enable()
Browse files Browse the repository at this point in the history
Turn streaming off (by selecting alternate setting 0) and disable the
video buffers queue in the uvc_video_enable() error path.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Laurent Pinchart authored and Mauro Carvalho Chehab committed Dec 11, 2011
1 parent 6998b6f commit 24c3aae
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions drivers/media/video/uvc/uvc_video.c
Original file line number Diff line number Diff line change
Expand Up @@ -1283,6 +1283,11 @@ int uvc_video_enable(struct uvc_streaming *stream, int enable)
return ret;
}

return uvc_init_video(stream, GFP_KERNEL);
}
ret = uvc_init_video(stream, GFP_KERNEL);
if (ret < 0) {
usb_set_interface(stream->dev->udev, stream->intfnum, 0);
uvc_queue_enable(&stream->queue, 0);
}

return ret;
}

0 comments on commit 24c3aae

Please sign in to comment.