diff options
author | Axel Lin <axel.lin@ingics.com> | 2013-04-30 10:18:23 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2013-05-21 08:37:11 -0300 |
commit | 7accedd2fa059961629fd47212dd7096370c64fb (patch) | |
tree | cc0c1035b6e4945618a7218accc84f9ac1438733 | |
parent | c6f89116c14144c18295d2a06294788c86fe9e6d (diff) | |
download | blackbird-obmc-linux-7accedd2fa059961629fd47212dd7096370c64fb.tar.gz blackbird-obmc-linux-7accedd2fa059961629fd47212dd7096370c64fb.zip |
[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>
-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 b0ff67bc1b05..d05eaa2c8490 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)); |