diff options
author | Axel Lin <axel.lin@ingics.com> | 2013-04-30 13:18:23 (GMT) |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2013-05-21 11:37:11 (GMT) |
commit | 7accedd2fa059961629fd47212dd7096370c64fb (patch) | |
tree | cc0c1035b6e4945618a7218accc84f9ac1438733 /drivers/media/platform/exynos4-is/fimc-is-regs.c | |
parent | c6f89116c14144c18295d2a06294788c86fe9e6d (diff) | |
download | linux-fsl-qoriq-7accedd2fa059961629fd47212dd7096370c64fb.tar.xz |
[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>
Diffstat (limited to 'drivers/media/platform/exynos4-is/fimc-is-regs.c')
-rw-r--r-- | drivers/media/platform/exynos4-is/fimc-is-regs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/platform/exynos4-is/fimc-is-regs.c b/drivers/media/platform/exynos4-is/fimc-is-regs.c index b0ff67b..d05eaa2 100644 --- a/drivers/media/platform/exynos4-is/fimc-is-regs.c +++ b/drivers/media/platform/exynos4-is/fimc-is-regs.c @@ -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)); |