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

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

[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: default avatarAxel Lin <axel.lin@ingics.com>
Acked-by: default avatarAndrzej Hajda <a.hajda@samsung.com>
Signed-off-by: default avatarSylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 84107253
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);