lkml.org 
[lkml]   [2010]   [Apr]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 17/19] staging:iio:ring_sw: Fix incorrect test on successful read of last value, causes infinite loop
Date
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
---
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 4e5134c..8d2f7cd 100644
--- a/drivers/staging/iio/ring_sw.c
+++ b/drivers/staging/iio/ring_sw.c
@@ -297,7 +297,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);
--
1.6.4.4


\
 
 \ /
  Last update: 2010-04-26 21:31    [W:0.080 / U:0.124 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site