From: Hans Verkuil Date: Fri, 18 Jul 2014 08:15:21 +0000 (-0300) Subject: [media] v4l2-ctrls: fix corner case in round-to-range code X-Git-Tag: omap-for-v3.17/fixes-against-rc2~155^2~215 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=958c7c7e65999c61af7da0812d2de12daa8fc29e;p=pandora-kernel.git [media] v4l2-ctrls: fix corner case in round-to-range code If you have a maximum that is at the limit of what the type supports, and the step is > 1, then you can get wrap-around errors since the code assumes that the maximum that the type supports is ctrl->maximum + ctrl->step / 2. In practice this is always fine, but in artificially crafted ranges you will hit this bug. Since this is core code it should just work. This bug has always been there but since it doesn't cause problems in practice it was never noticed. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- Reading git-diff-tree failed