iio staging: fix lis3l02dq, read error handling
authorPeter Meerwald <pmeerw@pmeerw.net>
Sun, 7 Jul 2013 20:24:00 +0000 (21:24 +0100)
committerJonathan Cameron <jic23@kernel.org>
Tue, 9 Jul 2013 21:11:53 +0000 (22:11 +0100)
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/staging/iio/accel/lis3l02dq_core.c

index 1bfe5d8..8ed75a9 100644 (file)
@@ -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;