Skip to content

Commit

Permalink
[media] exynos4-is: Fix off-by-one valid range checking for is->confi…
Browse files Browse the repository at this point in the history
…g_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>
  • Loading branch information
Axel Lin authored and Mauro Carvalho Chehab committed May 21, 2013
1 parent c6f8911 commit 7accedd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/media/platform/exynos4-is/fimc-is-regs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit 7accedd

Please sign in to comment.