Commit 708706ff authored by Peter Meerwald's avatar Peter Meerwald Committed by Greg Kroah-Hartman

staging: iio: fix trigger handler of iio_simple_dummy driver

accessing first and last channel fails:
fakedata[0] is never accessed, out-of-bound access for last channel
Signed-off-by: default avatarPeter Meerwald <pmeerw@pmeerw.net>
Acked-by: default avatarJonathan Cameron <jic23@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 971ff1db
......@@ -75,9 +75,9 @@ static irqreturn_t iio_simple_dummy_trigger_h(int irq, void *p)
for (i = 0, j = 0;
i < bitmap_weight(indio_dev->active_scan_mask,
indio_dev->masklength);
i++) {
i++, j++) {
j = find_next_bit(buffer->scan_mask,
indio_dev->masklength, j + 1);
indio_dev->masklength, j);
/* random access read from the 'device' */
data[i] = fakedata[j];
len += 2;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment