]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
media: i2c: ov5670: Fix PIXEL_RATE minimum value
authorJacopo Mondi <jacopo@jmondi.org>
Mon, 21 Dec 2020 17:52:20 +0000 (18:52 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Mar 2021 17:22:41 +0000 (18:22 +0100)
commit717aeb383ac53eb5508a0764dea469600646fa4c
tree6d34367fda87d78cd28913a19b85a33709ccd587
parent5054cdc89d55462fbaf92ada552d48328c0ee75c
media: i2c: ov5670: Fix PIXEL_RATE minimum value

[ Upstream commit dc1eb7c9c290cba52937c9a224b22a400bb0ffd7 ]

The driver currently reports a single supported value for
V4L2_CID_PIXEL_RATE and initializes the control's minimum value to 0,
which is very risky, as userspace might accidentally use it as divider
when calculating the time duration of a line.

Fix this by using as minimum the only supported value when registering
the control.

Fixes: 5de35c9b8dcd1 ("media: i2c: Add Omnivision OV5670 5M sensor support")
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/i2c/ov5670.c