From 17c88eb6a09bafb75644b8c37fd65c89c8f49bec Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Fri, 8 Jun 2012 09:54:03 +0300 Subject: iio: frequency: ad9523: unlock on error in ad9523_reg_access() There was a return path which got missed accidentally. Signed-off-by: Dan Carpenter Acked-by: Michael Hennerich Signed-off-by: Greg Kroah-Hartman --- drivers/iio/frequency/ad9523.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'drivers/iio/frequency') diff --git a/drivers/iio/frequency/ad9523.c b/drivers/iio/frequency/ad9523.c index 7272924484c..832e6ab2611 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; -- cgit v1.2.3-70-g09d2