Message ID | b24e53350906120951l552301c8x71b17fa4d45c8d1b@mail.gmail.com (mailing list archive) |
---|---|
State | Accepted |
Headers | show |
On Friday 12 June 2009 18:51:03 Robert Krakora wrote: > From: Robert Krakora <rob.krakora@messagenetsystems.com> > > Fix for no return value check of uvc_ctrl_set() which calls > mutex_lock_interruptible(). > > Priority: normal > > Signed-off-by: Robert Krakora <rob.krakora@messagenetsystems.com> Acked-by: Laurent Pinchart <laurent.pinchart@skynet.be> I'd appreciate if you would at least CC me when submitting patches related to the Linux UVC driver in the future. Regards, Laurent Pinchart -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff -r bff77ec33116 linux/drivers/media/video/uvc/uvc_v4l2.c --- a/linux/drivers/media/video/uvc/uvc_v4l2.c Thu Jun 11 18:44:23 2009 -0300 +++ b/linux/drivers/media/video/uvc/uvc_v4l2.c Fri Jun 12 11:35:04 2009 -0400 @@ -538,7 +538,10 @@ memset(&xctrl, 0, sizeof xctrl); xctrl.id = ctrl->id; - uvc_ctrl_begin(video); + ret = uvc_ctrl_begin(video); + if (ret < 0) + return ret; + ret = uvc_ctrl_get(video, &xctrl); uvc_ctrl_rollback(video); if (ret >= 0) @@ -555,7 +558,10 @@ xctrl.id = ctrl->id; xctrl.value = ctrl->value; - uvc_ctrl_begin(video); + ret = uvc_ctrl_begin(video); + if (ret < 0) + return ret; + ret = uvc_ctrl_set(video, &xctrl); if (ret < 0) { uvc_ctrl_rollback(video); @@ -574,7 +580,10 @@ struct v4l2_ext_control *ctrl = ctrls->controls; unsigned int i; - uvc_ctrl_begin(video); + ret = uvc_ctrl_begin(video); + if (ret < 0) + return ret; + for (i = 0; i < ctrls->count; ++ctrl, ++i) { ret = uvc_ctrl_get(video, ctrl); if (ret < 0) {