summaryrefslogtreecommitdiffstats
path: root/drivers/iio/frequency
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/iio/frequency')
-rw-r--r--drivers/iio/frequency/ad9523.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/iio/frequency/ad9523.c b/drivers/iio/frequency/ad9523.c
index 7272924484c1..832e6ab26114 100644
--- a/drivers/iio/frequency/ad9523.c
+++ b/drivers/iio/frequency/ad9523.c
@@ -731,10 +731,12 @@ static int ad9523_reg_access(struct iio_dev *indio_dev,
} else {
ret = ad9523_read(indio_dev, reg | AD9523_R1B);
if (ret < 0)
- return ret;
+ goto out_unlock;
*readval = ret;
ret = 0;
}
+
+out_unlock:
mutex_unlock(&indio_dev->mlock);
return ret;