diff options
author | Colin Ian King <colin.king@canonical.com> | 2021-10-15 17:32:54 +0200 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2021-10-20 15:43:51 +0200 |
commit | eeb82b54bb03a0899505996e8da7d67b4ff4aec2 (patch) | |
tree | 7b5e44ede776e8e7c8be781f2278a0f90ea823fe /drivers/iio | |
parent | iio: adc: lpc18xx_adc: Convert probe to device managed version (diff) | |
download | linux-eeb82b54bb03a0899505996e8da7d67b4ff4aec2.tar.xz linux-eeb82b54bb03a0899505996e8da7d67b4ff4aec2.zip |
iio: buffer: Fix uninitialized variable ret
When !iio_buffer_space_available(rb) is true and signal_pending(current)
is false the end of the do-while loop is reached and the uninitialized
variable ret is zero checked. Fix this by initializing variable ret to
zero.
Addresses-Coverity: ("Uninitialized scalar variable")
Fixes: 9eeee3b0bf19 ("iio: Add output buffer support")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20211015153254.33783-1-colin.king@canonical.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio')
-rw-r--r-- | drivers/iio/industrialio-buffer.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio/industrialio-buffer.c index b884d78657cb..c97fb8462395 100644 --- a/drivers/iio/industrialio-buffer.c +++ b/drivers/iio/industrialio-buffer.c @@ -179,7 +179,7 @@ static ssize_t iio_buffer_write(struct file *filp, const char __user *buf, struct iio_buffer *rb = ib->buffer; struct iio_dev *indio_dev = ib->indio_dev; DEFINE_WAIT_FUNC(wait, woken_wake_function); - int ret; + int ret = 0; size_t written; if (!indio_dev->info) |