mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-05 21:44:23 -04:00
staging:iio:ring_sw: Fix incorrect test on successful read of last value, causes infinite loop
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
3bf877c1cc
commit
8474ddd7cb
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user