diff options
author | Peter Meerwald <pmeerw@pmeerw.net> | 2012-06-22 07:47:41 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-06-23 04:24:27 (GMT) |
commit | 708706ff290545decbb7f43b533cb247e8ff64fd (patch) | |
tree | 6ec237bb2e412ff73aa65952c696f8e897859626 /drivers/staging/iio/iio_simple_dummy_buffer.c | |
parent | 971ff1db41b0f16f34cfdeb9e0460d7dc598e68e (diff) | |
download | linux-708706ff290545decbb7f43b533cb247e8ff64fd.tar.xz |
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: Peter Meerwald <pmeerw@pmeerw.net>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/iio/iio_simple_dummy_buffer.c')
-rw-r--r-- | drivers/staging/iio/iio_simple_dummy_buffer.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/iio/iio_simple_dummy_buffer.c b/drivers/staging/iio/iio_simple_dummy_buffer.c index fa4939c..d911960 100644 --- a/drivers/staging/iio/iio_simple_dummy_buffer.c +++ b/drivers/staging/iio/iio_simple_dummy_buffer.c @@ -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; |