staging:iio:ring_sw: Fix incorrect test on successful read of last value, causes...
authorJonathan Cameron <jic23@cam.ac.uk>
Tue, 4 May 2010 13:43:11 +0000 (14:43 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 11 May 2010 18:36:06 +0000 (11:36 -0700)
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/iio/ring_sw.c

index f8de45dc4b6e3528b70ed2ce9fe91b65f8cb753d..5ee3e4533515d7c2bb6669c1582ba16c356b94ed 100644 (file)
@@ -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);