Skip to content

Commit

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

0 comments on commit c6f8911

Please sign in to comment.