Re: [patch] [media] s5k6aa: off by one in s5k6aa_enum_frame_interval()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Dan,

Thank you for the patch.

On Friday 23 August 2013 12:33:06 Dan Carpenter wrote:
> The check is off by one so we could read one space past the end of the
> array.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>

Acked-by: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx>

Mauro, I have no other pending sensor patches, can you pick this one up from 
the list, or should I send you a pull request ?

> diff --git a/drivers/media/i2c/s5k6aa.c b/drivers/media/i2c/s5k6aa.c
> index 789c02a..629a5cd 100644
> --- a/drivers/media/i2c/s5k6aa.c
> +++ b/drivers/media/i2c/s5k6aa.c
> @@ -1003,7 +1003,7 @@ static int s5k6aa_enum_frame_interval(struct
> v4l2_subdev *sd, const struct s5k6aa_interval *fi;
>  	int ret = 0;
> 
> -	if (fie->index > ARRAY_SIZE(s5k6aa_intervals))
> +	if (fie->index >= ARRAY_SIZE(s5k6aa_intervals))
>  		return -EINVAL;
> 
>  	v4l_bound_align_image(&fie->width, S5K6AA_WIN_WIDTH_MIN,

-- 
Regards,

Laurent Pinchart

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux