[media] s5c73m3: Fix off-by-one valid range checking for fie->index

Current code uses fie->index as array subscript, thus the valid value range
is 0 ... ARRAY_SIZE(s5c73m3_intervals) - 1.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
Axel Lin 2013-04-30 00:42:16 -03:00 committed by Mauro Carvalho Chehab
parent 8410725333
commit c6f89116c1
1 changed files with 1 additions and 1 deletions

View File

@ -956,7 +956,7 @@ static int s5c73m3_oif_enum_frame_interval(struct v4l2_subdev *sd,
if (fie->pad != OIF_SOURCE_PAD)
return -EINVAL;
if (fie->index > ARRAY_SIZE(s5c73m3_intervals))
if (fie->index >= ARRAY_SIZE(s5c73m3_intervals))
return -EINVAL;
mutex_lock(&state->lock);