Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

[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
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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));