diff options
author | Dan Carpenter <error27@gmail.com> | 2011-07-30 08:45:09 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-08-02 23:07:51 (GMT) |
commit | 8f89615528b11eabda68faaf2438d09c9565a125 (patch) | |
tree | 9fe0e6b804aedbc05eff1f176c3e9ba73c9d9b22 /drivers/staging/iio/accel/adis16209_core.c | |
parent | c060ae7db4ebf1e5e08199b2aec12f051189041a (diff) | |
download | linux-8f89615528b11eabda68faaf2438d09c9565a125.tar.xz |
Staging: iio: add some unlocks to raw_read() functions
This code was cut and pasted in several places. It's missing some
unlocks on error.
Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/iio/accel/adis16209_core.c')
-rw-r--r-- | drivers/staging/iio/accel/adis16209_core.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/staging/iio/accel/adis16209_core.c b/drivers/staging/iio/accel/adis16209_core.c index 55f3a7b..bec1fa8 100644 --- a/drivers/staging/iio/accel/adis16209_core.c +++ b/drivers/staging/iio/accel/adis16209_core.c @@ -337,13 +337,17 @@ static int adis16209_read_raw(struct iio_dev *indio_dev, mutex_lock(&indio_dev->mlock); addr = adis16209_addresses[chan->address][0]; ret = adis16209_spi_read_reg_16(indio_dev, addr, &val16); - if (ret) + if (ret) { + mutex_unlock(&indio_dev->mlock); return ret; + } if (val16 & ADIS16209_ERROR_ACTIVE) { ret = adis16209_check_status(indio_dev); - if (ret) + if (ret) { + mutex_unlock(&indio_dev->mlock); return ret; + } } val16 = val16 & ((1 << chan->scan_type.realbits) - 1); if (chan->scan_type.sign == 's') |