summaryrefslogtreecommitdiffstats
path: root/drivers/iio
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2016-11-24 16:38:07 +0300
committerJonathan Cameron <jic23@kernel.org>2016-11-24 20:09:55 +0000
commit0e8d2b0f74c07e68d6fa6ea3113de5735d59d018 (patch)
tree3129d6649cecada623f07caf7583ad0412b00f61 /drivers/iio
parent9049531c91b4ed7948d7c8bf6e945f5da56fc501 (diff)
downloadop-kernel-dev-0e8d2b0f74c07e68d6fa6ea3113de5735d59d018.zip
op-kernel-dev-0e8d2b0f74c07e68d6fa6ea3113de5735d59d018.tar.gz
iio: tsl2583: make array large enough
This array is supposed to have 10 elements. Smatch complains that with the current code we can have n == max_ints and read beyond the end of the array. Fixes: ac4f6eee8fe8 ("staging: iio: TAOS tsl258x: Device driver") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Brian Masney <masneyb@onstation.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio')
-rw-r--r--drivers/iio/light/tsl2583.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iio/light/tsl2583.c b/drivers/iio/light/tsl2583.c
index 0b87f6a..a78b602 100644
--- a/drivers/iio/light/tsl2583.c
+++ b/drivers/iio/light/tsl2583.c
@@ -565,7 +565,7 @@ static ssize_t in_illuminance_lux_table_store(struct device *dev,
struct iio_dev *indio_dev = dev_to_iio_dev(dev);
struct tsl2583_chip *chip = iio_priv(indio_dev);
const unsigned int max_ints = TSL2583_MAX_LUX_TABLE_ENTRIES * 3;
- int value[TSL2583_MAX_LUX_TABLE_ENTRIES * 3];
+ int value[TSL2583_MAX_LUX_TABLE_ENTRIES * 3 + 1];
int ret = -EINVAL;
unsigned int n;
OpenPOWER on IntegriCloud