From: Dan Carpenter Date: Wed, 11 Jul 2012 06:34:00 +0000 (+0100) Subject: iio: double unlock on error path X-Git-Tag: firefly_0821_release~3680^2~2356^2~298^2 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=e59b9afecf7ddf52d31d24e800b473f19c23cfe0;p=firefly-linux-kernel-4.4.55.git iio: double unlock on error path We should be holding the mutex when we goto error_free_chans. Signed-off-by: Dan Carpenter Signed-off-by: Jonathan Cameron --- 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: