mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-20 03:04:01 +08:00
[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:
parent
8410725333
commit
c6f89116c1
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user