diff mbox

uvcvideo: check minimum border of control

Message ID 4B5F60B0.7090709@freemail.hu (mailing list archive)
State Rejected
Headers show

Commit Message

Németh Márton Jan. 26, 2010, 9:37 p.m. UTC
None
diff mbox

Patch

diff --git a/drivers/media/video/uvc/uvc_ctrl.c b/drivers/media/video/uvc/uvc_ctrl.c
--- a/drivers/media/video/uvc/uvc_ctrl.c
+++ b/drivers/media/video/uvc/uvc_ctrl.c
@@ -1068,6 +1068,8 @@  int uvc_ctrl_set(struct uvc_video_chain *chain,
 				    uvc_ctrl_data(ctrl, UVC_CTRL_DATA_RES));

 		xctrl->value = min + (xctrl->value - min + step/2) / step * step;
+		if (xctrl->value < min)
+			xctrl->value = min;
 		if (xctrl->value > max)
 			xctrl->value = max;
 		value = xctrl->value;