diff options
author | Dan Carpenter <error27@gmail.com> | 2011-06-30 09:01:31 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-07-06 03:34:58 (GMT) |
commit | 85ee35e50d9d416cbe76e8af2b216e1760241400 (patch) | |
tree | 0826be760f45bb8adab40c0685212c7956c5f594 /drivers | |
parent | 7bcf302ff151da6559261bc73e8b9d1ae31cc0bb (diff) | |
download | linux-85ee35e50d9d416cbe76e8af2b216e1760241400.tar.xz |
Staging: iio: release locks on error paths
There are a couple places here where we should have called
mutex_unlock() before returning.
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')
-rw-r--r-- | drivers/staging/iio/accel/adis16201_core.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/staging/iio/accel/adis16201_core.c b/drivers/staging/iio/accel/adis16201_core.c index cbc59c5..2fd01ae 100644 --- a/drivers/staging/iio/accel/adis16201_core.c +++ b/drivers/staging/iio/accel/adis16201_core.c @@ -305,13 +305,17 @@ static int adis16201_read_raw(struct iio_dev *indio_dev, mutex_lock(&indio_dev->mlock); addr = adis16201_addresses[chan->address][0]; ret = adis16201_spi_read_reg_16(indio_dev, addr, &val16); - if (ret) + if (ret) { + mutex_unlock(&indio_dev->mlock); return ret; + } if (val16 & ADIS16201_ERROR_ACTIVE) { ret = adis16201_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') |