aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/iio/inkern.c3
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)
198 iio_device_get(chans[mapind].indio_dev); 198 iio_device_get(chans[mapind].indio_dev);
199 mapind++; 199 mapind++;
200 } 200 }
201 mutex_unlock(&iio_map_list_lock);
202 if (mapind == 0) { 201 if (mapind == 0) {
203 ret = -ENODEV; 202 ret = -ENODEV;
204 goto error_free_chans; 203 goto error_free_chans;
205 } 204 }
205 mutex_unlock(&iio_map_list_lock);
206
206 return chans; 207 return chans;
207 208
208error_free_chans: 209error_free_chans: