Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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: