diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2012-07-11 08:34:00 +0200 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2012-07-12 21:00:20 +0200 |
commit | e59b9afecf7ddf52d31d24e800b473f19c23cfe0 (patch) | |
tree | 812dfea07e848bc7b308cdbd50a396689a86705b /drivers/iio | |
parent | iio: dac: ad5064: fix section mismatch in ad5064_init() in linux-next (diff) | |
download | linux-e59b9afecf7ddf52d31d24e800b473f19c23cfe0.tar.xz linux-e59b9afecf7ddf52d31d24e800b473f19c23cfe0.zip |
iio: double unlock on error path
We should be holding the mutex when we goto error_free_chans.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio')
-rw-r--r-- | drivers/iio/inkern.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/iio/inkern.c b/drivers/iio/inkern.c index e2aded04996b..b5afc2ff34fd 100644 --- a/drivers/iio/inkern.c +++ b/drivers/iio/inkern.c @@ -198,11 +198,12 @@ struct iio_channel *iio_channel_get_all(const char *name) iio_device_get(chans[mapind].indio_dev); mapind++; } - mutex_unlock(&iio_map_list_lock); if (mapind == 0) { ret = -ENODEV; goto error_free_chans; } + mutex_unlock(&iio_map_list_lock); + return chans; error_free_chans: |