diff options
author | Jonathan Cameron <jic23@cam.ac.uk> | 2010-03-30 12:45:04 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-04-30 12:30:09 -0400 |
commit | 4845187b39b79e3c1d4474c2767ddc7fb493eb05 (patch) | |
tree | 78743d925597e96220b6a1d63fdd3f72bac1f766 /drivers | |
parent | a8947fcf3bbeda9fc6ff1205e51f8ff1b0128cc4 (diff) |
staging: iio: ring_sw: Fix incorrect test on successful read of last value, causes infinite loop
This is a bad one. The test means that almost no reads of the last
value ever succeed! Result is an infinite loop.
Another one for the 'oops' category.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/iio/ring_sw.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/iio/ring_sw.c b/drivers/staging/iio/ring_sw.c index b104c3d9c35e..cf22c091668c 100644 --- a/drivers/staging/iio/ring_sw.c +++ b/drivers/staging/iio/ring_sw.c | |||
@@ -293,7 +293,7 @@ again: | |||
293 | return -EAGAIN; | 293 | return -EAGAIN; |
294 | memcpy(data, last_written_p_copy, ring->buf.bpd); | 294 | memcpy(data, last_written_p_copy, ring->buf.bpd); |
295 | 295 | ||
296 | if (unlikely(ring->last_written_p >= last_written_p_copy)) | 296 | if (unlikely(ring->last_written_p != last_written_p_copy)) |
297 | goto again; | 297 | goto again; |
298 | 298 | ||
299 | iio_unmark_sw_rb_in_use(&ring->buf); | 299 | iio_unmark_sw_rb_in_use(&ring->buf); |