diff options
-rw-r--r-- | drivers/iio/kfifo_buf.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/iio/kfifo_buf.c b/drivers/iio/kfifo_buf.c index 847ca561afe0..55c267bbfd2f 100644 --- a/drivers/iio/kfifo_buf.c +++ b/drivers/iio/kfifo_buf.c | |||
@@ -38,7 +38,8 @@ static int iio_request_update_kfifo(struct iio_buffer *r) | |||
38 | kfifo_free(&buf->kf); | 38 | kfifo_free(&buf->kf); |
39 | ret = __iio_allocate_kfifo(buf, buf->buffer.bytes_per_datum, | 39 | ret = __iio_allocate_kfifo(buf, buf->buffer.bytes_per_datum, |
40 | buf->buffer.length); | 40 | buf->buffer.length); |
41 | buf->update_needed = false; | 41 | if (ret >= 0) |
42 | buf->update_needed = false; | ||
42 | } else { | 43 | } else { |
43 | kfifo_reset_out(&buf->kf); | 44 | kfifo_reset_out(&buf->kf); |
44 | } | 45 | } |