aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2016-04-29 05:03:31 -0400
committerJonathan Cameron <jic23@kernel.org>2016-05-04 05:52:43 -0400
commit04bf02175fe9577875fb8285cc2d08169fef613a (patch)
tree9bd4c2b87fa0124f91a29eea7b3dfdb39fd586fb
parentc25d3f37be016b301f446a5257645c4845daf53c (diff)
iio: dac: ad5592r: Off by one bug in ad5592r_alloc_channels()
The > here should be >= or we go beyond the end for the array. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
-rw-r--r--drivers/iio/dac/ad5592r-base.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iio/dac/ad5592r-base.c b/drivers/iio/dac/ad5592r-base.c
index 948f600e7059..69bde5909854 100644
--- a/drivers/iio/dac/ad5592r-base.c
+++ b/drivers/iio/dac/ad5592r-base.c
@@ -525,7 +525,7 @@ static int ad5592r_alloc_channels(struct ad5592r_state *st)
525 525
526 device_for_each_child_node(st->dev, child) { 526 device_for_each_child_node(st->dev, child) {
527 ret = fwnode_property_read_u32(child, "reg", &reg); 527 ret = fwnode_property_read_u32(child, "reg", &reg);
528 if (ret || reg > ARRAY_SIZE(st->channel_modes)) 528 if (ret || reg >= ARRAY_SIZE(st->channel_modes))
529 continue; 529 continue;
530 530
531 ret = fwnode_property_read_u32(child, "adi,mode", &tmp); 531 ret = fwnode_property_read_u32(child, "adi,mode", &tmp);