]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
hwmon: (raspberrypi) Fix delayed-work teardown race
authorShubham Chakraborty <chakrabortyshubham66@gmail.com>
Sun, 17 May 2026 08:04:45 +0000 (13:34 +0530)
committerGuenter Roeck <linux@roeck-us.net>
Tue, 9 Jun 2026 15:23:05 +0000 (08:23 -0700)
commiteb0d491e2787aa359f0d930151ff6e5e5df70fb9
tree9caf22cca8ee9051707ad45e509a0ccd2532bb53
parent78a3e36eec06a0dc4a205c753e7754e9f9408fba
hwmon: (raspberrypi) Fix delayed-work teardown race

The delayed polling work rearms itself from the work function, so use
explicit delayed-work setup and cleanup instead of
devm_delayed_work_autocancel().

Initialize the delayed work with INIT_DELAYED_WORK() and register a
devres cleanup action that calls disable_delayed_work_sync() during
teardown.

This addresses the concern raised during review about the polling work
being able to requeue itself while the driver is being removed.

Signed-off-by: Shubham Chakraborty <chakrabortyshubham66@gmail.com>
Link: https://lore.kernel.org/r/20260517080445.103962-4-chakrabortyshubham66@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/raspberrypi-hwmon.c