linux/drivers/iio
Linus Walleij 3aa385a9c7 iio: accel: bmc150: Fix irq assumption regression
The code in bmc150-accel-core.c unconditionally calls
bmc150_accel_set_interrupt() in the iio_buffer_setup_ops,
such as on the runtime PM resume path giving a kernel
splat like this if the device has no interrupts:

Unable to handle kernel NULL pointer dereference at virtual
  address 00000001 when read

PC is at bmc150_accel_set_interrupt+0x98/0x194
LR is at __pm_runtime_resume+0x5c/0x64
(...)
Call trace:
bmc150_accel_set_interrupt from bmc150_accel_buffer_postenable+0x40/0x108
bmc150_accel_buffer_postenable from __iio_update_buffers+0xbe0/0xcbc
__iio_update_buffers from enable_store+0x84/0xc8
enable_store from kernfs_fop_write_iter+0x154/0x1b4

This bug seems to have been in the driver since the beginning,
but it only manifests recently, I do not know why.

Store the IRQ number in the state struct, as this is a common
pattern in other drivers, then use this to determine if we have
IRQ support or not.

Cc: stable@vger.kernel.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-11-11 20:22:23 +00:00
..
accel iio: accel: bmc150: Fix irq assumption regression 2025-11-11 20:22:23 +00:00
adc iio: adc: ad7124: fix temperature channel 2025-10-13 08:38:09 +01:00
addac treewide: rename GPIO set callbacks back to their original names 2025-08-07 10:07:06 +02:00
afe iio: normalize array sentinel style 2025-04-22 19:10:04 +01:00
amplifiers iio: amplifiers: ad8366: make ad8366_info const 2025-07-06 10:37:52 +01:00
buffer iio: buffer-dmaengine: enable .get_dma_dev() 2025-10-13 08:38:08 +01:00
cdc iio: normalize array sentinel style 2025-04-22 19:10:04 +01:00
chemical iio: chemical: Remove redundant pm_runtime_mark_last_busy() calls 2025-08-25 15:57:34 +01:00
common iio:common:ssp_sensors: Fix an error handling path ssp_probe() 2025-10-13 08:38:09 +01:00
dac IIO: New device support, features and cleanup for 6.18 2025-09-23 14:15:25 +02:00
dummy iio: dummy: Switch to iio_push_to_buffers_with_ts() and provide size of storage 2025-05-21 14:20:26 +01:00
filter iio: normalize array sentinel style 2025-04-22 19:10:04 +01:00
frequency IIO: New device support, features and cleanup for 6.18 2025-09-23 14:15:25 +02:00
gyro iio: gyro: Remove redundant pm_runtime_mark_last_busy() calls 2025-08-25 16:04:47 +01:00
health iio: health: Drop unnecessary -ENOMEM messages 2025-08-25 12:35:25 +01:00
humidity iio: humditiy: hdc3020: fix units for thresholds and hysteresis 2025-10-19 11:46:24 +01:00
imu iio: st_lsm6dsx: Fixed calibrated timestamp calculation 2025-10-27 13:29:12 +00:00
light Linux 6.17-rc3 2025-09-13 15:00:48 +01:00
magnetometer iio: magnetometer: tmag5273: remove unused IIO_CHAN_INFO_PROCESSED handling 2025-09-10 19:47:06 +01:00
multiplexer iio: normalize array sentinel style 2025-04-22 19:10:04 +01:00
orientation iio: orientation: hid-sensor-rotation: remove unnecessary alignment 2025-05-21 14:20:28 +01:00
position iio: normalize array sentinel style 2025-04-22 19:10:04 +01:00
potentiometer iio: potentiometer: Drop unused export.h includes 2025-06-26 19:32:52 +01:00
potentiostat iio: potentiostat: Drop unnecessary -ENOMEM messages 2025-08-25 12:36:29 +01:00
pressure iio: pressure: bmp280: correct meas_time_us calculation 2025-10-13 08:38:08 +01:00
proximity Linux 6.17-rc3 2025-09-13 15:00:48 +01:00
resolver iio: Remove single use of macro definition for driver name 2025-06-09 07:45:36 +01:00
temperature Linux 6.17-rc3 2025-09-13 15:00:48 +01:00
test iio: test: Add KUnit tests for iio_multiply_value() 2025-09-10 19:47:05 +01:00
trigger iio: trigger: stm32-lptimer: Fix build warnings about export.h 2025-06-26 19:32:52 +01:00
Kconfig
Makefile
TODO
iio_core.h
iio_core_trigger.h
industrialio-acpi.c
industrialio-backend.c Char / Misc / IIO / other driver updates for 6.17-rc1 2025-07-29 09:52:01 -07:00
industrialio-buffer.c iio: buffer: support getting dma channel from the buffer 2025-10-13 08:38:08 +01:00
industrialio-configfs.c
industrialio-core.c iio: add power and energy measurement modifiers 2025-09-13 13:47:19 +01:00
industrialio-event.c
industrialio-gts-helper.c
industrialio-sw-device.c
industrialio-sw-trigger.c
industrialio-trigger.c
industrialio-triggered-event.c
inkern.c iio: Improve iio_read_channel_processed_scale() precision 2025-09-10 19:47:04 +01:00