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:07:38 +0000 (10:07 +0200)
commit73c165a6f3828c61d2a0e725597ffc6e07c0c40b
tree87fa2f18677b1d9e326aa5b6d78e905153c7c809
parentdd1e7b2406492f2fc833a148d470fbc4abb5b45e
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