Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4845187b authored by Jonathan Cameron's avatar Jonathan Cameron Committed by Greg Kroah-Hartman
Browse files

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



This is a bad one. The test means that almost no reads of the last
value ever succeed!  Result is an infinite loop.

Another one for the 'oops' category.

Signed-off-by: default avatarJonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent a8947fcf
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -293,7 +293,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);