summaryrefslogtreecommitdiffstats
path: root/drivers/iio/dac
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2012-10-24 08:13:00 +0100
committerJonathan Cameron <jic23@kernel.org>2012-10-31 10:59:55 +0000
commit0c88d23c66884e6ac2995d4d7f881b41e0cfd27c (patch)
tree5e63a05eabae25f26f7f1cf4755afbc306194590 /drivers/iio/dac
parent6b3aa3131a7804640e7589e5629036f660362f0b (diff)
iio:dac:ad5449: unlock on error path
There is an unlock missing on this error path. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio/dac')
-rw-r--r--drivers/iio/dac/ad5449.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/iio/dac/ad5449.c b/drivers/iio/dac/ad5449.c
index 5b43030fe6e..0ee6f8eeba8 100644
--- a/drivers/iio/dac/ad5449.c
+++ b/drivers/iio/dac/ad5449.c
@@ -124,12 +124,13 @@ static int ad5449_read(struct iio_dev *indio_dev, unsigned int addr,
ret = spi_sync(st->spi, &msg);
if (ret < 0)
- return ret;
+ goto out_unlock;
*val = be16_to_cpu(st->data[1]);
- mutex_unlock(&indio_dev->mlock);
- return 0;
+out_unlock:
+ mutex_unlock(&indio_dev->mlock);
+ return ret;
}
static int ad5449_read_raw(struct iio_dev *indio_dev,