Commit d278d447 authored by Lorenzo Bianconi's avatar Lorenzo Bianconi Committed by Jonathan Cameron
Browse files

iio: imu: st_lsm6dsx: grab conf mutex in st_lsm6dsx_write_event_config



Always grub conf mutex in st_lsm6dsx_write_event_config since it can run
concurrently with FIFO configuration

Fixes: b5969abf ("iio: imu: st_lsm6dsx: add motion events")
Signed-off-by: default avatarLorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 04ca37d5
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1619,7 +1619,9 @@ static int st_lsm6dsx_write_event_config(struct iio_dev *iio_dev,
	if (err < 0)
		return err;

	mutex_lock(&hw->conf_lock);
	err = st_lsm6dsx_sensor_set_enable(sensor, state);
	mutex_unlock(&hw->conf_lock);
	if (err < 0)
		return err;