Skip to content

iio: PM-enable leak on probe error path (goto-variant drivers)

Stepan Ionichev linux-iio lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 5 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4iio: light: pa12203001: use devm_pm_runtime_enable() to fix probe error pathdrivers/iio/light/pa12203001.c+3 -41 reply
2/4iio: light: us5182d: use devm_pm_runtime_enable() to fix probe error pathdrivers/iio/light/us5182d.c+3 -41 reply
3/4iio: light: apds9960: use devm_pm_runtime_enable() to fix probe error pathdrivers/iio/light/apds9960.c+3 -31 reply
4/4iio: accel: mma8452: use devm_pm_runtime_enable() to fix probe error pathdrivers/iio/accel/mma8452.c+3 -41 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/4] iio: PM-enable leak on probe error path (goto-variant drivers)

This is the goto-variant follow-up to the standalone ti-ads1015 patch and the 4-patch series for the simple drivers. In these four drivers probe calls pm_runtime_enable() but the existing register-failure path jumps to a manual cleanup label (out_err / buffer_cleanup / error_power_down) rather than returning directly. None of those cleanup labels call pm_runtime_disable(), so the runtime PM enable_count leaks on probe failure and on subsequent rebind.

The conversion is the same as in the rest of the class: replace pm_runtime_enable() with devm_pm_runtime_enable() and drop the pm_runtime_disable() / pm_runtime_set_suspended() calls in .remove(). On the new error path from devm_pm_runtime_enable() each patch jumps to the same existing cleanup label that iio_device_register() uses, so the manual unwind for the non-devm resources held earlier in probe still runs. In apds9960 nothing is powered or registered at that point so a plain return is used.

Standalone precedent already on the list:
iio: adc: ti-ads1015 -
https://lore.kernel.org/all/[email protected]/

Companion 4-patch series for the simple-return drivers (isl29028, tsl2583, mlx90614, bmi088-accel) was posted alongside this one.

Stepan Ionichev (4):
iio: light: pa12203001: use devm_pm_runtime_enable() to fix probe
error path
iio: light: us5182d: use devm_pm_runtime_enable() to fix probe error
path
iio: light: apds9960: use devm_pm_runtime_enable() to fix probe error
path
iio: accel: mma8452: use devm_pm_runtime_enable() to fix probe error
path

 drivers/iio/accel/mma8452.c    | 7 +++----
 drivers/iio/light/apds9960.c   | 6 +++---
 drivers/iio/light/pa12203001.c | 7 +++----
 drivers/iio/light/us5182d.c    | 7 +++----
 4 files changed, 12 insertions(+), 15 deletions(-)

base-commit: 7cb1c5b32a2bfde961fff8d5204526b609bcb30a

Signature · 1 line
2.43.0