linux/drivers/iio/common
Maud Spierings 610615c966 iio: common: st_sensors: Fix use of uninitialize device structs
commit 9f92e93e25 upstream.

Throughout the various probe functions &indio_dev->dev is used before it
is initialized. This caused a kernel panic in st_sensors_power_enable()
when the call to devm_regulator_bulk_get_enable() fails and then calls
dev_err_probe() with the uninitialized device.

This seems to only cause a panic with dev_err_probe(), dev_err(),
dev_warn() and dev_info() don't seem to cause a panic, but are fixed
as well.

The issue is reported and traced here: [1]

Link: https://lore.kernel.org/all/AM7P189MB100986A83D2F28AF3FFAF976E39EA@AM7P189MB1009.EURP189.PROD.OUTLOOK.COM/ [1]
Cc: stable@vger.kernel.org
Signed-off-by: Maud Spierings <maudspierings@gocontroll.com>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Link: https://... [1]
Link: https://patch.msgid.link/20250527-st_iio_fix-v4-1-12d89801c761@gocontroll.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2025-07-24 08:56:28 +02:00
..
cros_ec_sensors iio: common: cros_ec_sensors_core: use new '.masklength' accessors 2024-08-03 10:13:43 +01:00
hid-sensors iio: hid-sensors: Fix an error handling path in _hid_sensor_set_report_latency() 2024-10-10 18:50:30 +01:00
inv_sensors iio: invensense: fix multiple odr switch when FIFO is off 2024-12-09 10:41:09 +01:00
ms_sensors iio: common: ms_sensors: ms_sensors_i2c: fix humidity conversion time table 2023-11-16 19:35:41 +00:00
scmi_sensors iio: common: scmi_iio: Remove unnecessary u64 type cast 2024-08-03 10:13:37 +01:00
ssp_sensors iio: common: ssp: Fix alignment for DMA safety 2022-06-14 11:53:15 +01:00
st_sensors iio: common: st_sensors: Fix use of uninitialize device structs 2025-07-24 08:56:28 +02:00
Kconfig iio: move inv_icm42600 timestamp module in common 2023-07-20 19:21:28 +01:00
Makefile iio: move inv_icm42600 timestamp module in common 2023-07-20 19:21:28 +01:00