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>
This commit is contained in:
Dan Carpenter 2012-07-11 07:34:00 +01:00 committed by Jonathan Cameron
parent 21fa54e401
commit e59b9afecf
1 changed files with 2 additions and 1 deletions

View File

@ -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: