Skip to content

Commit

Permalink
staging: iio: fix trigger handler of iio_simple_dummy driver
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Peter Meerwald authored and Greg Kroah-Hartman committed Jun 23, 2012
1 parent 971ff1d commit 708706f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/staging/iio/iio_simple_dummy_buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 708706f

Please sign in to comment.