]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
iio: ensure ret is initialized to zero before entering do loop
authorColin Ian King <colin.king@canonical.com>
Mon, 5 Sep 2016 14:39:06 +0000 (15:39 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 24 Sep 2016 08:09:31 +0000 (10:09 +0200)
commit919771b81fa24edb8ff056d5c10cff630615dc38
tree1ffbc7f14e07f6268f8999213617322e2decfa6a
parenta3a4fce551ff24b53e04825b9cde6de126888768
iio: ensure ret is initialized to zero before entering do loop

commit 5dba4b14bafe801083d01e1f400816df7e5a8f2e upstream.

A recent fix to iio_buffer_read_first_n_outer removed ret from being set by
a return from wait_event_interruptible and also added a continue in a loop
which causes the variable ret to not be set when it reaches the end of the
loop.  Fix this by initializing ret to zero.

Also remove extraneous white space at the end of the loop.

Fixes: fcf68f3c0bb2a5 ("fix sched WARNING "do not call blocking ops when !TASK_RUNNING")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iio/industrialio-buffer.c