Commit 7accedd2 authored by Axel Lin's avatar Axel Lin Committed by Mauro Carvalho Chehab

[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: default avatarAxel Lin <axel.lin@ingics.com>
Signed-off-by: default avatarSylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent c6f89116
...@@ -174,7 +174,7 @@ int fimc_is_hw_change_mode(struct fimc_is *is) ...@@ -174,7 +174,7 @@ int fimc_is_hw_change_mode(struct fimc_is *is)
HIC_CAPTURE_STILL, HIC_CAPTURE_VIDEO, 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; return -EINVAL;
mcuctl_write(cmd[is->config_index], is, MCUCTL_REG_ISSR(0)); mcuctl_write(cmd[is->config_index], is, MCUCTL_REG_ISSR(0));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment