summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorPeter Meerwald <pmeerw@pmeerw.net>2013-07-08 00:24:00 +0400
committerJonathan Cameron <jic23@kernel.org>2013-07-10 01:11:53 +0400
commit8f6817a0a57cf15935f8f076d0ade34da01cf26d (patch)
treefb16b3a1e79a6cbdbc60b30061bb6e0da3ccca9a /drivers
parentbb3779610254ea5efbf8ec727138e041d801747c (diff)
downloadlinux-8f6817a0a57cf15935f8f076d0ade34da01cf26d.tar.xz
iio staging: fix lis3l02dq, read error handling
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers')
-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 1bfe5d81792b..8ed75a94f465 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;