diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2011-10-25 08:03:42 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-12-11 08:13:29 -0500 |
commit | 24c3aae0c740ae9837284266ea82234415721dc1 (patch) | |
tree | a6ba9f1ff29057195ef6ea9bb2ae7ea6eb99e524 /drivers/media/video/uvc | |
parent | 6998b6fb4b1c8f320adeee938d399c4d8dcc90e2 (diff) |
[media] uvcvideo: Handle uvc_init_video() failure in uvc_video_enable()
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>
Diffstat (limited to 'drivers/media/video/uvc')
-rw-r--r-- | drivers/media/video/uvc/uvc_video.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/media/video/uvc/uvc_video.c b/drivers/media/video/uvc/uvc_video.c index 2995f26ccae9..2e5e72825ad1 100644 --- a/drivers/media/video/uvc/uvc_video.c +++ b/drivers/media/video/uvc/uvc_video.c | |||
@@ -1283,6 +1283,11 @@ int uvc_video_enable(struct uvc_streaming *stream, int enable) | |||
1283 | return ret; | 1283 | return ret; |
1284 | } | 1284 | } |
1285 | 1285 | ||
1286 | return uvc_init_video(stream, GFP_KERNEL); | 1286 | ret = uvc_init_video(stream, GFP_KERNEL); |
1287 | } | 1287 | if (ret < 0) { |
1288 | usb_set_interface(stream->dev->udev, stream->intfnum, 0); | ||
1289 | uvc_queue_enable(&stream->queue, 0); | ||
1290 | } | ||
1288 | 1291 | ||
1292 | return ret; | ||
1293 | } | ||