[PATCH 0/4] iio: fix PM-enable leak on probe error path across 4 drivers

Stepan Ionichev posted 4 patches 1 week, 3 days ago
drivers/iio/accel/bmi088-accel-core.c | 6 +++---
drivers/iio/light/isl29028.c          | 7 +++----
drivers/iio/light/tsl2583.c           | 6 +++---
drivers/iio/temperature/mlx90614.c    | 6 +++---
4 files changed, 12 insertions(+), 13 deletions(-)
[PATCH 0/4] iio: fix PM-enable leak on probe error path across 4 drivers
Posted by Stepan Ionichev 1 week, 3 days ago
This series fixes a class of runtime PM enable_count leaks on probe error
paths across drivers/iio/.

Each affected driver calls pm_runtime_enable() in probe and then a non-devm
registration function (typically iio_device_register()).  When the
registration fails the probe returns directly without calling
pm_runtime_disable(); on subsequent probe/rebind the runtime PM tracking
complains about an unbalanced enable.

The fix is the same in each driver: replace pm_runtime_enable() with
devm_pm_runtime_enable() and drop the now-redundant pm_runtime_disable()
and pm_runtime_set_suspended() calls in the .remove() callback.  The devm
action runs after .remove() and handles the teardown.

drivers/iio/adc/ti-ads1015.c was posted as a standalone patch earlier:
https://lore.kernel.org/all/20260529101011.3030-1-sozdayvek@gmail.com/

A separate follow-up will cover four more drivers (apds9960, mma8452,
pa12203001, us5182d) where the same leak exists but the probe error
path needs a goto to the existing manual cleanup label rather than a
plain return.

Stepan Ionichev (4):
  iio: light: isl29028: use devm_pm_runtime_enable() to fix probe error
    path
  iio: light: tsl2583: use devm_pm_runtime_enable() to fix probe error
    path
  iio: temperature: mlx90614: use devm_pm_runtime_enable() to fix probe
    error path
  iio: accel: bmi088-accel: use devm_pm_runtime_enable() to fix probe
    error path

 drivers/iio/accel/bmi088-accel-core.c | 6 +++---
 drivers/iio/light/isl29028.c          | 7 +++----
 drivers/iio/light/tsl2583.c           | 6 +++---
 drivers/iio/temperature/mlx90614.c    | 6 +++---
 4 files changed, 12 insertions(+), 13 deletions(-)


base-commit: 7cb1c5b32a2bfde961fff8d5204526b609bcb30a
-- 
2.43.0
Re: [PATCH 0/4] iio: fix PM-enable leak on probe error path across 4 drivers
Posted by Joshua Crofts 1 week, 2 days ago
On Fri, 29 May 2026 at 12:51, Stepan Ionichev <sozdayvek@gmail.com> wrote:
>
> This series fixes a class of runtime PM enable_count leaks on probe error
> paths across drivers/iio/.
>
> Each affected driver calls pm_runtime_enable() in probe and then a non-devm
> registration function (typically iio_device_register()).  When the
> registration fails the probe returns directly without calling
> pm_runtime_disable(); on subsequent probe/rebind the runtime PM tracking
> complains about an unbalanced enable.
>
> The fix is the same in each driver: replace pm_runtime_enable() with
> devm_pm_runtime_enable() and drop the now-redundant pm_runtime_disable()
> and pm_runtime_set_suspended() calls in the .remove() callback.  The devm
> action runs after .remove() and handles the teardown.
>
> drivers/iio/adc/ti-ads1015.c was posted as a standalone patch earlier:
> https://lore.kernel.org/all/20260529101011.3030-1-sozdayvek@gmail.com/
>
> A separate follow-up will cover four more drivers (apds9960, mma8452,
> pa12203001, us5182d) where the same leak exists but the probe error
> path needs a goto to the existing manual cleanup label rather than a
> plain return.
>
> Stepan Ionichev (4):
>   iio: light: isl29028: use devm_pm_runtime_enable() to fix probe error
>     path
>   iio: light: tsl2583: use devm_pm_runtime_enable() to fix probe error
>     path
>   iio: temperature: mlx90614: use devm_pm_runtime_enable() to fix probe
>     error path
>   iio: accel: bmi088-accel: use devm_pm_runtime_enable() to fix probe
>     error path
>
>  drivers/iio/accel/bmi088-accel-core.c | 6 +++---
>  drivers/iio/light/isl29028.c          | 7 +++----
>  drivers/iio/light/tsl2583.c           | 6 +++---
>  drivers/iio/temperature/mlx90614.c    | 6 +++---

I guess something happened to your formatting, because all of the commit
messages exceed the 72 character column length.

-- 
Kind regards

CJD