]> www.infradead.org Git - users/dwmw2/linux.git/commit
iio: common: st_sensors: Fix use of uninitialize device structs
authorMaud Spierings <maudspierings@gocontroll.com>
Tue, 27 May 2025 06:36:08 +0000 (08:36 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 29 Jun 2025 16:15:39 +0000 (17:15 +0100)
commit9f92e93e257b33e73622640a9205f8642ec16ddd
treecd2d7da7617bb7952ddbf6618403eb802fc0b5da
parent6ac609d1fba19d5d40fb3c81201ffadcb6d00fb3
iio: common: st_sensors: Fix use of uninitialize device structs

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/
Cc: stable@vger.kernel.org
Signed-off-by: Maud Spierings <maudspierings@gocontroll.com>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Link: https://...
Link: https://patch.msgid.link/20250527-st_iio_fix-v4-1-12d89801c761@gocontroll.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/accel/st_accel_core.c
drivers/iio/common/st_sensors/st_sensors_core.c
drivers/iio/common/st_sensors/st_sensors_trigger.c