[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>
This commit is contained in:
Laurent Pinchart 2011-10-25 09:03:42 -03:00 committed by Mauro Carvalho Chehab
parent 6998b6fb4b
commit 24c3aae0c7

View file

@ -1283,6 +1283,11 @@ int uvc_video_enable(struct uvc_streaming *stream, int enable)
return ret; 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;
}