Commit 17c88eb6 authored by Dan Carpenter's avatar Dan Carpenter Committed by Greg Kroah-Hartman

iio: frequency: ad9523: unlock on error in ad9523_reg_access()

There was a return path which got missed accidentally.
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Acked-by: default avatarMichael Hennerich <michael.hennerich@analog.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 03afcf47
...@@ -731,10 +731,12 @@ static int ad9523_reg_access(struct iio_dev *indio_dev, ...@@ -731,10 +731,12 @@ static int ad9523_reg_access(struct iio_dev *indio_dev,
} else { } else {
ret = ad9523_read(indio_dev, reg | AD9523_R1B); ret = ad9523_read(indio_dev, reg | AD9523_R1B);
if (ret < 0) if (ret < 0)
return ret; goto out_unlock;
*readval = ret; *readval = ret;
ret = 0; ret = 0;
} }
out_unlock:
mutex_unlock(&indio_dev->mlock); mutex_unlock(&indio_dev->mlock);
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment