summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Meerwald <pmeerw@pmeerw.net>2013-07-07 21:24:00 +0100
committerJonathan Cameron <jic23@kernel.org>2013-07-09 22:11:53 +0100
commit8f6817a0a57cf15935f8f076d0ade34da01cf26d (patch)
treefb16b3a1e79a6cbdbc60b30061bb6e0da3ccca9a
parentbb3779610254ea5efbf8ec727138e041d801747c (diff)
downloadop-kernel-dev-8f6817a0a57cf15935f8f076d0ade34da01cf26d.zip
op-kernel-dev-8f6817a0a57cf15935f8f076d0ade34da01cf26d.tar.gz
iio staging: fix lis3l02dq, read error handling
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
-rw-r--r--drivers/staging/iio/accel/lis3l02dq_core.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/staging/iio/accel/lis3l02dq_core.c b/drivers/staging/iio/accel/lis3l02dq_core.c
index 1bfe5d8..8ed75a9 100644
--- a/drivers/staging/iio/accel/lis3l02dq_core.c
+++ b/drivers/staging/iio/accel/lis3l02dq_core.c
@@ -257,6 +257,8 @@ static int lis3l02dq_read_raw(struct iio_dev *indio_dev,
ret = lis3l02dq_read_reg_s16(indio_dev, reg, val);
}
mutex_unlock(&indio_dev->mlock);
+ if (ret < 0)
+ goto error_ret;
return IIO_VAL_INT;
case IIO_CHAN_INFO_SCALE:
*val = 0;
OpenPOWER on IntegriCloud