aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iio
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2012-06-08 02:54:03 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-06-12 17:45:16 -0400
commit17c88eb6a09bafb75644b8c37fd65c89c8f49bec (patch)
treec654f4655a5cc51ca5bd39b74fbe296be45cc9e9 /drivers/iio
parent03afcf472785a63d720202d28d51852d965a95d9 (diff)
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,
731 } else { 731 } else {
732 ret = ad9523_read(indio_dev, reg | AD9523_R1B); 732 ret = ad9523_read(indio_dev, reg | AD9523_R1B);
733 if (ret < 0) 733 if (ret < 0)
734 return ret; 734 goto out_unlock;
735 *readval = ret; 735 *readval = ret;
736 ret = 0; 736 ret = 0;
737 } 737 }
738
739out_unlock:
738 mutex_unlock(&indio_dev->mlock); 740 mutex_unlock(&indio_dev->mlock);
739 741
740 return ret; 742 return ret;