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>
This commit is contained in:
Jonathan Cameron 2010-03-30 17:45:04 +01:00 committed by Greg Kroah-Hartman
parent a8947fcf3b
commit 4845187b39

View file

@ -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);