diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2012-06-08 02:54:03 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-06-12 17:45:16 -0400 |
commit | 17c88eb6a09bafb75644b8c37fd65c89c8f49bec (patch) | |
tree | c654f4655a5cc51ca5bd39b74fbe296be45cc9e9 /drivers/iio | |
parent | 03afcf472785a63d720202d28d51852d965a95d9 (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.c | 4 |
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 | |||
739 | out_unlock: | ||
738 | mutex_unlock(&indio_dev->mlock); | 740 | mutex_unlock(&indio_dev->mlock); |
739 | 741 | ||
740 | return ret; | 742 | return ret; |