Commit e59b9afe authored by Dan Carpenter's avatar Dan Carpenter Committed by Jonathan Cameron

iio: double unlock on error path

We should be holding the mutex when we goto error_free_chans.
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent 21fa54e4
...@@ -198,11 +198,12 @@ struct iio_channel *iio_channel_get_all(const char *name) ...@@ -198,11 +198,12 @@ struct iio_channel *iio_channel_get_all(const char *name)
iio_device_get(chans[mapind].indio_dev); iio_device_get(chans[mapind].indio_dev);
mapind++; mapind++;
} }
mutex_unlock(&iio_map_list_lock);
if (mapind == 0) { if (mapind == 0) {
ret = -ENODEV; ret = -ENODEV;
goto error_free_chans; goto error_free_chans;
} }
mutex_unlock(&iio_map_list_lock);
return chans; return chans;
error_free_chans: error_free_chans:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment