staging:iio:ring_sw: Fix incorrect test on successful read of last value, causes infinite loop

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-05-04 14:43:11 +01:00 committed by Greg Kroah-Hartman
parent 3bf877c1cc
commit 8474ddd7cb

View file

@ -295,7 +295,7 @@ int iio_read_last_from_sw_ring(struct iio_sw_ring_buffer *ring,
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);