[1/2,media] tvp5150: off by one

Message ID 20160227105109.GD14086@mwanda (mailing list archive)
State Superseded, archived
Headers

Commit Message

Dan Carpenter Feb. 27, 2016, 10:51 a.m. UTC
  The ->input_ent[] array has TVP5150_INPUT_NUM elements so the > here
should be >=.

Fixes: f7b4b54e6364 ('[media] tvp5150: add HW input connectors support')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

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

Comments

Dan Carpenter Feb. 27, 2016, 10:55 a.m. UTC | #1
Oh...  There is no [patch 2/2].  I decided to report that one instead.

regards,
dan carpenter

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
  
Javier Martinez Canillas Feb. 28, 2016, 2:43 p.m. UTC | #2
Hello Dan,

On 02/27/2016 07:51 AM, Dan Carpenter wrote:
> The ->input_ent[] array has TVP5150_INPUT_NUM elements so the > here
> should be >=.
>
> Fixes: f7b4b54e6364 ('[media] tvp5150: add HW input connectors support')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>

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

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

Best regards,
  

Patch

diff --git a/drivers/media/i2c/tvp5150.c b/drivers/media/i2c/tvp5150.c
index ef393f5..ff18444 100644
--- a/drivers/media/i2c/tvp5150.c
+++ b/drivers/media/i2c/tvp5150.c
@@ -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;
 		}