summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorPeter Meerwald <pmeerw@pmeerw.net>2013-07-07 22:24:00 +0200
committerJonathan Cameron <jic23@kernel.org>2013-07-09 23:11:53 +0200
commit8f6817a0a57cf15935f8f076d0ade34da01cf26d (patch)
treefb16b3a1e79a6cbdbc60b30061bb6e0da3ccca9a /drivers
parentstaging:iio:ad7291: add missing .driver_module to struct iio_info (diff)
downloadlinux-8f6817a0a57cf15935f8f076d0ade34da01cf26d.tar.xz
linux-8f6817a0a57cf15935f8f076d0ade34da01cf26d.zip
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;