lkml.org 
[lkml]   [2016]   [Feb]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch 1/2] [media] 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')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

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;
}
\
 
 \ /
  Last update: 2016-02-27 12:21    [W:0.045 / U:1.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site