iio: imu: st_lsm6dsx: always check enable_reg in st_lsm6dsx_event_setup
authorLorenzo Bianconi <lorenzo@kernel.org>
Sun, 6 Oct 2019 13:22:00 +0000 (15:22 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Tue, 15 Oct 2019 20:11:05 +0000 (21:11 +0100)
commit84b2e7c319b8e9707c9c62eeeaf9cf937ef36cbd
treed06667483b000bb399197de111338413464fa4b8
parent66b662a1760e4c21af6f3aaf8dd575363c174473
iio: imu: st_lsm6dsx: always check enable_reg in st_lsm6dsx_event_setup

Check if enable_reg of event_settings data structure is defined before
writing on it

Fixes: b5969abfa8b8 ("iio: imu: st_lsm6dsx: add motion events")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Tested-by: Sean Nyekjaer <sean@geanix.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c