projects
/
GitHub
/
moto-9609
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c25d3f3
)
iio: dac: ad5592r: Off by one bug in ad5592r_alloc_channels()
author
Dan Carpenter
<dan.carpenter@oracle.com>
Fri, 29 Apr 2016 09:03:31 +0000
(12:03 +0300)
committer
Jonathan Cameron
<jic23@kernel.org>
Wed, 4 May 2016 09:52:43 +0000
(10:52 +0100)
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>
drivers/iio/dac/ad5592r-base.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/iio/dac/ad5592r-base.c
b/drivers/iio/dac/ad5592r-base.c
index 948f600e7059fb8837662a6aa01f3e72a3583100..69bde59098542daf480561c1bb113919736ccb2f 100644
(file)
--- 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)
device_for_each_child_node(st->dev, child) {
ret = fwnode_property_read_u32(child, "reg", ®);
- if (ret || reg > ARRAY_SIZE(st->channel_modes))
+ if (ret || reg >
=
ARRAY_SIZE(st->channel_modes))
continue;
ret = fwnode_property_read_u32(child, "adi,mode", &tmp);