iio: frequency: ad9523: unlock on error in ad9523_reg_access()
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 8 Jun 2012 06:54:03 +0000 (09:54 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Jun 2012 21:45:16 +0000 (14:45 -0700)
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>
drivers/iio/frequency/ad9523.c

index 7272924484c1962ffc18e6530e58227a4575fe44..832e6ab26114ec99a8d7821d92234427366b1e57 100644 (file)
@@ -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;