summaryrefslogtreecommitdiffstats
path: root/drivers/iio
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2012-06-08 09:54:03 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-06-12 14:45:16 -0700
commit17c88eb6a09bafb75644b8c37fd65c89c8f49bec (patch)
treec654f4655a5cc51ca5bd39b74fbe296be45cc9e9 /drivers/iio
parent03afcf472785a63d720202d28d51852d965a95d9 (diff)
downloadlinux-17c88eb6a09bafb75644b8c37fd65c89c8f49bec.tar.bz2
iio: frequency: ad9523: unlock on error in ad9523_reg_access()
There was a return path which got missed accidentally. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/iio')
-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;