From: Arina Kharlamova fxas21002c_regulators_get() passes dev->parent to devm_regulator_get(). dev is the I2C client or SPI device, so its parent is the bus adapter or controller. The vdd-supply and vddio-supply properties of the sensor node are never used, and the regulator references are added to the bus device. They are not dropped when the sensor driver is unbound or its probe fails, so each probe adds two more. Pass the sensor device. Fixes: a0701b6263ae ("iio: gyro: add core driver for fxas21002c") Cc: stable@vger.kernel.org Signed-off-by: Arina Kharlamova --- The supplies are looked up on the bus device, so the sensor's own supply properties are ignored and references leak on every probe. I found this with spec2patch. I model-checked the probe and remove paths of the driver with CBMC against formal specifications of the kernel APIs it calls. The specifications are checked against the kernel source, and some of them are proved in Rocq against a transcription of the kernel code. I also checked lock usage separately. With the help of an AI coding assistant (Claude); I reviewed the analysis and the fix. Compile-tested only, not tested on hardware. --- drivers/iio/gyro/fxas21002c_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/gyro/fxas21002c_core.c b/drivers/iio/gyro/fxas21002c_core.c index a88670207cec..aa12783579c1 100644 --- a/drivers/iio/gyro/fxas21002c_core.c +++ b/drivers/iio/gyro/fxas21002c_core.c @@ -912,11 +912,11 @@ static int fxas21002c_regulators_get(struct fxas21002c_data *data) { struct device *dev = regmap_get_device(data->regmap); - data->vdd = devm_regulator_get(dev->parent, "vdd"); + data->vdd = devm_regulator_get(dev, "vdd"); if (IS_ERR(data->vdd)) return PTR_ERR(data->vdd); - data->vddio = devm_regulator_get(dev->parent, "vddio"); + data->vddio = devm_regulator_get(dev, "vddio"); return PTR_ERR_OR_ZERO(data->vddio); } --- base-commit: 23c47e17ad8c18057f17be2a5beeccde9b5ca112 change-id: 20261201-s2p-lpr-iio-a5a7788c9af7 Best regards, -- Arina Kharlamova