diff options
author | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2019-08-22 17:55:07 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2019-08-26 20:05:09 +0300 |
commit | 093347abc7a4e0490e3c962ecbde2dc272a8f708 (patch) | |
tree | 3903cdeeea2628b0e151a2fbda2175f25ef9db01 /drivers/media/pci | |
parent | 31b8b0bd6e55c3ea5a08bb8141fa5d3c90600e3b (diff) | |
download | linux-093347abc7a4e0490e3c962ecbde2dc272a8f708.tar.xz |
media: ov9650: add a sanity check
As pointed by cppcheck:
[drivers/media/i2c/ov9650.c:706]: (error) Shifting by a negative value is undefined behaviour
[drivers/media/i2c/ov9650.c:707]: (error) Shifting by a negative value is undefined behaviour
[drivers/media/i2c/ov9650.c:721]: (error) Shifting by a negative value is undefined behaviour
Prevent mangling with gains with invalid values.
As pointed by Sylvester, this should never happen in practice,
as min value of V4L2_CID_GAIN control is 16 (gain is always >= 16
and m is always >= 0), but it is too hard for a static analyzer
to get this, as the logic with validates control min/max is
elsewhere inside V4L2 core.
Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media/pci')
0 files changed, 0 insertions, 0 deletions