[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:
Родитель
8410725333
Коммит
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);
|
||||
|
|
Загрузка…
Ссылка в новой задаче