Skip to content

Commit

Permalink
staging:iio:ring_sw: Fix incorrect test on successful read of last va…
Browse files Browse the repository at this point in the history
…lue, causes infinite loop

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Jonathan Cameron authored and Greg Kroah-Hartman committed May 11, 2010
1 parent 3bf877c commit 8474ddd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/staging/iio/ring_sw.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 8474ddd

Please sign in to comment.