提交 f68e68d2 编写于 作者: D Dan Carpenter 提交者: Mauro Carvalho Chehab

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: 8a77009b ("media: ov5695: add support for OV5695 sensor")
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
上级 67f2219c
...@@ -884,7 +884,7 @@ static int ov5695_enum_frame_sizes(struct v4l2_subdev *sd, ...@@ -884,7 +884,7 @@ static int ov5695_enum_frame_sizes(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_pad_config *cfg,
struct v4l2_subdev_frame_size_enum *fse) struct v4l2_subdev_frame_size_enum *fse)
{ {
if (fse->index > ARRAY_SIZE(supported_modes)) if (fse->index >= ARRAY_SIZE(supported_modes))
return -EINVAL; return -EINVAL;
if (fse->code != MEDIA_BUS_FMT_SBGGR10_1X10) if (fse->code != MEDIA_BUS_FMT_SBGGR10_1X10)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册