diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2018-03-01 13:07:14 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2018-03-06 20:25:10 +0300 |
commit | f68e68d2923069fd9b21aa1e7ed445cda2f6db05 (patch) | |
tree | c20d3b0adf2ad7c21371f0c7c3a516f035c92564 /drivers/media/i2c/ov5695.c | |
parent | 67f2219ce1d11a0e160f6aa0b463aee1614f0b9c (diff) | |
download | linux-f68e68d2923069fd9b21aa1e7ed445cda2f6db05.tar.xz |
media: ov5695: Off by one in ov5695_enum_frame_sizes()
The ">" should be ">=" so that we don't read one element beyond the end
of the array.
Fixes: 8a77009be4be ("media: ov5695: add support for OV5695 sensor")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/i2c/ov5695.c')
-rw-r--r-- | drivers/media/i2c/ov5695.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/i2c/ov5695.c b/drivers/media/i2c/ov5695.c index a4985a4715f5..9be38a0a2046 100644 --- a/drivers/media/i2c/ov5695.c +++ b/drivers/media/i2c/ov5695.c @@ -884,7 +884,7 @@ static int ov5695_enum_frame_sizes(struct v4l2_subdev *sd, struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_frame_size_enum *fse) { - if (fse->index > ARRAY_SIZE(supported_modes)) + if (fse->index >= ARRAY_SIZE(supported_modes)) return -EINVAL; if (fse->code != MEDIA_BUS_FMT_SBGGR10_1X10) |