mirror of
https://github.com/torvalds/linux.git
synced 2024-11-01 09:41:44 +00:00
[media] exynos4-is: Fix off-by-one valid range checking for is->config_index
Current code uses is->config_index as array subscript, thus the valid value range is 0 ... ARRAY_SIZE(cmd) - 1. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
parent
c6f89116c1
commit
7accedd2fa
@ -174,7 +174,7 @@ int fimc_is_hw_change_mode(struct fimc_is *is)
|
||||
HIC_CAPTURE_STILL, HIC_CAPTURE_VIDEO,
|
||||
};
|
||||
|
||||
if (WARN_ON(is->config_index > ARRAY_SIZE(cmd)))
|
||||
if (WARN_ON(is->config_index >= ARRAY_SIZE(cmd)))
|
||||
return -EINVAL;
|
||||
|
||||
mcuctl_write(cmd[is->config_index], is, MCUCTL_REG_ISSR(0));
|
||||
|
Loading…
Reference in New Issue
Block a user