summaryrefslogtreecommitdiff
path: root/scripts/reference_init.pl
diff options
context:
space:
mode:
authorFrancesco Lavra <flavra@baylibre.com>2025-12-01 13:00:10 +0300
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2025-12-21 14:14:10 +0300
commitc34e2e2d67b3bb8d5a6d09b0d6dac845cdd13fb3 (patch)
tree0c4e2ff76c944235b846d62889495c133f315d66 /scripts/reference_init.pl
parentda934ef0fdff5ba21e82ec3ab3f95fe73137b0c9 (diff)
downloadlinux-c34e2e2d67b3bb8d5a6d09b0d6dac845cdd13fb3.tar.xz
iio: imu: st_lsm6dsx: fix iio_chan_spec for sensors without event detection
The st_lsm6dsx_acc_channels array of struct iio_chan_spec has a non-NULL event_spec field, indicating support for IIO events. However, event detection is not supported for all sensors, and if userspace tries to configure accelerometer wakeup events on a sensor device that does not support them (e.g. LSM6DS0), st_lsm6dsx_write_event() dereferences a NULL pointer when trying to write to the wakeup register. Define an additional struct iio_chan_spec array whose members have a NULL event_spec field, and use this array instead of st_lsm6dsx_acc_channels for sensors without event detection capability. Fixes: b5969abfa8b8 ("iio: imu: st_lsm6dsx: add motion events") Signed-off-by: Francesco Lavra <flavra@baylibre.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Acked-by: Lorenzo Bianconi <lorenzo@kernel.org> Cc: stable@vger.kernel.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'scripts/reference_init.pl')
0 files changed, 0 insertions, 0 deletions