diff options
author | Jonathan Cameron <jic23@cam.ac.uk> | 2010-03-30 16:45:04 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-04-30 16:30:09 (GMT) |
commit | 4845187b39b79e3c1d4474c2767ddc7fb493eb05 (patch) | |
tree | 78743d925597e96220b6a1d63fdd3f72bac1f766 /drivers | |
parent | a8947fcf3bbeda9fc6ff1205e51f8ff1b0128cc4 (diff) | |
download | linux-fsl-qoriq-4845187b39b79e3c1d4474c2767ddc7fb493eb05.tar.xz |
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 b104c3d..cf22c09 100644 --- a/drivers/staging/iio/ring_sw.c +++ b/drivers/staging/iio/ring_sw.c @@ -293,7 +293,7 @@ again: return -EAGAIN; memcpy(data, last_written_p_copy, ring->buf.bpd); - if (unlikely(ring->last_written_p >= last_written_p_copy)) + if (unlikely(ring->last_written_p != last_written_p_copy)) goto again; iio_unmark_sw_rb_in_use(&ring->buf); |