All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] iio staging: fix trigger handler of iio_simple_dummy driver
@ 2012-06-21 21:02 Peter Meerwald
  2012-06-21 21:02 ` [PATCH 2/3] iio staging: simplify timestamp alignment in iio_simple_dummy Peter Meerwald
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Peter Meerwald @ 2012-06-21 21:02 UTC (permalink / raw)
  To: linux-iio; +Cc: jic23, Peter Meerwald

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>
---
 drivers/staging/iio/iio_simple_dummy_buffer.c |    4 ++--
 1 file 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;
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 7+ messages in thread
* [PATCH 1/3] iio staging: fix trigger handler of iio_simple_dummy driver
@ 2012-06-22  7:47 Peter Meerwald
  2012-06-22  7:47 ` [PATCH 2/3] iio staging: simplify timestamp alignment in iio_simple_dummy Peter Meerwald
  0 siblings, 1 reply; 7+ messages in thread
From: Peter Meerwald @ 2012-06-22  7:47 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-iio, Peter Meerwald

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>

---
 drivers/staging/iio/iio_simple_dummy_buffer.c |    4 ++--
 1 file 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;
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-06-22  7:47 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-21 21:02 [PATCH 1/3] iio staging: fix trigger handler of iio_simple_dummy driver Peter Meerwald
2012-06-21 21:02 ` [PATCH 2/3] iio staging: simplify timestamp alignment in iio_simple_dummy Peter Meerwald
2012-06-22  7:36   ` Jonathan Cameron
2012-06-21 21:02 ` [PATCH 3/3] iio staging: fix typo, improve timestamp alignment comment Peter Meerwald
2012-06-22  7:39   ` Jonathan Cameron
2012-06-22  7:38 ` [PATCH 1/3] iio staging: fix trigger handler of iio_simple_dummy driver Jonathan Cameron
  -- strict thread matches above, loose matches on Subject: below --
2012-06-22  7:47 Peter Meerwald
2012-06-22  7:47 ` [PATCH 2/3] iio staging: simplify timestamp alignment in iio_simple_dummy Peter Meerwald

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.