Skip to contentSkip to conversation

tvp5150: off by one

PATCH In review Dan Carpenter 2 participants 3 messages Feb 27, 2016 – Feb 28, 2016

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

PATCH 1/2 tvp5150: off by one

The ->input_ent[] array has TVP5150_INPUT_NUM elements so the > here should be >=.

Fixes f7b4b54e6364 ('[media] tvp5150: add HW input connectors support')
drivers/media/i2c/tvp5150.c +1 -1
index ef393f5..ff18444 100644
@@ -1386,7 +1386,7 @@ static int tvp5150_parse_dt(struct tvp5150 *decoder, struct device_node *np)
 			goto err_connector;
 		}
 
-		if (input_type > TVP5150_INPUT_NUM) {
+		if (input_type >= TVP5150_INPUT_NUM) {
 			ret = -EINVAL;
 			goto err_connector;
 		}
#1 lore raw

Oh... There is no [patch 2/2]. I decided to report that one instead.

regards,
dan carpenter

#2 lore raw
In reply to Dan Carpenter

Hello Dan,

Quoted 6 lines · Dan Carpenter

The ->input_ent[] array has TVP5150_INPUT_NUM elements so the > here should be >=.

Fixes f7b4b54e6364 ('[media] tvp5150: add HW input connectors support')

Thanks for the patch but Mauro already posted the same change before:

http://www.spinics.net/lists/linux-media/msg97721.html

Best regards,

Signature · 3 lines
Javier Martinez Canillas
Open Source Group
Samsung Research America