Skip to contentSkip to conversation

i2c: ov2659: signedness bug inov2659_set_fmt()

media Dan Carpenter 3 participants 3 messages Apr 15, 2015 – Apr 16, 2015

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

This needs to be signed or there is a risk of hitting a forever loop.

Fixes c4c0283ab3cd ('[media] media: i2c: add support for omnivision's ov2659 sensor')
drivers/media/i2c/ov2659.c +1 -1
index edebd11..d700a1d 100644
@@ -1102,7 +1102,7 @@ static int ov2659_set_fmt(struct v4l2_subdev *sd,
 			  struct v4l2_subdev_format *fmt)
 {
 	struct i2c_client *client = v4l2_get_subdevdata(sd);
-	unsigned int index = ARRAY_SIZE(ov2659_formats);
+	int index = ARRAY_SIZE(ov2659_formats);
 	struct v4l2_mbus_framefmt *mf = &fmt->format;
 	const struct ov2659_framesize *size = NULL;
 	struct ov2659 *ov2659 = to_ov2659(sd);
maintainer Acked-by
#1 lore raw
Quoted 5 lines · Dan Carpenter

This needs to be signed or there is a risk of hitting a forever loop.

Fixes c4c0283ab3cd ('[media] media: i2c: add support for omnivision's ov2659 sensor')

Cheers,
--Prabhakar Lad

Quoted 13 lines
drivers/media/i2c/ov2659.c +1 -1
index edebd11..d700a1d 100644
@@ -1102,7 +1102,7 @@ static int ov2659_set_fmt(struct v4l2_subdev *sd,
                          struct v4l2_subdev_format *fmt)
 {
        struct i2c_client *client = v4l2_get_subdevdata(sd);
-       unsigned int index = ARRAY_SIZE(ov2659_formats);
+       int index = ARRAY_SIZE(ov2659_formats);
        struct v4l2_mbus_framefmt *mf = &fmt->format;
        const struct ov2659_framesize *size = NULL;
        struct ov2659 *ov2659 = to_ov2659(sd);
Acked-by
#2 lore raw
In reply to Dan Carpenter

Dan Carpenter <[email protected]> wrote on Wed [2015-Apr-15 22:12:18 +0300]:

Quoted 5 lines

This needs to be signed or there is a risk of hitting a forever loop.

Fixes c4c0283ab3cd ('[media] media: i2c: add support for omnivision's ov2659 sensor')
Quoted 13 lines
drivers/media/i2c/ov2659.c +1 -1
index edebd11..d700a1d 100644
@@ -1102,7 +1102,7 @@ static int ov2659_set_fmt(struct v4l2_subdev *sd,
 			  struct v4l2_subdev_format *fmt)
 {
 	struct i2c_client *client = v4l2_get_subdevdata(sd);
-	unsigned int index = ARRAY_SIZE(ov2659_formats);
+	int index = ARRAY_SIZE(ov2659_formats);
 	struct v4l2_mbus_framefmt *mf = &fmt->format;
 	const struct ov2659_framesize *size = NULL;
 	struct ov2659 *ov2659 = to_ov2659(sd);