From 8474ddd7cba04c2e8d8691abda32ae0f4a684137 Mon Sep 17 00:00:00 2001 From: Jonathan Cameron Date: Tue, 4 May 2010 14:43:11 +0100 Subject: [PATCH] staging:iio:ring_sw: Fix incorrect test on successful read of last value, causes infinite loop Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman --- drivers/staging/iio/ring_sw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/iio/ring_sw.c b/drivers/staging/iio/ring_sw.c index f8de45dc4b6..5ee3e453351 100644 --- a/drivers/staging/iio/ring_sw.c +++ b/drivers/staging/iio/ring_sw.c @@ -295,7 +295,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); -- 2.11.4.GIT