Re: [PATCH v2] hwmon: (npcm750-pwm-fan): stop fan timer on device detach

Guenter Roeck <[email protected]> Wed, 29 Jul 2026 09:21:37 -0700
Newsgroups org.ozlabs.lists.openbmc,org.kernel.vger.linux-hwmon,org.kernel.vger.linux-kernel,org.kernel.vger.stable
Message-ID <[email protected]>
On Wed, Jul 29, 2026 at 06:01:16PM +0800, Hongyan Xu wrote:
> When a fan tach channel is present, npcm7xx_pwm_fan_probe() starts
> fan_timer. The timer callback polls tach state and rearms the timer, but
> the driver has no remove callback or devm cleanup action to stop it. On
> device detach, the devm-managed driver data and I/O mappings can be
> released while the timer is still pending or running.
> 
> Register a devm cleanup action before starting the timer and shut the
> timer down synchronously from that action.
> 
> This issue was found by a static analysis tool.
> 
> Fixes: f1fd4a4db777 ("hwmon: Add NPCM7xx PWM and Fan driver")
> Cc: [email protected]
> Signed-off-by: Hongyan Xu <[email protected]>

Applied.

Thanks,
Guenter