[PATCH 1/2] uvc: Fix for no return value check of uvc_ctrl_set() which calls mutex_lock_interruptible()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Robert Krakora <rob.krakora@xxxxxxxxxxxxxxxxxxxxx>

Fix for no return value check of uvc_ctrl_set() which calls
mutex_lock_interruptible().

Priority: normal

Signed-off-by: Robert Krakora <rob.krakora@xxxxxxxxxxxxxxxxxxxxx>

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) {
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux