From 8f6817a0a57cf15935f8f076d0ade34da01cf26d Mon Sep 17 00:00:00 2001 From: Peter Meerwald Date: Sun, 7 Jul 2013 21:24:00 +0100 Subject: [PATCH] iio staging: fix lis3l02dq, read error handling Signed-off-by: Peter Meerwald Signed-off-by: Jonathan Cameron --- drivers/staging/iio/accel/lis3l02dq_core.c | 2 ++ 1 file changed, 2 insertions(+) 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;