summaryrefslogtreecommitdiff
path: root/rust
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2026-10-27 09:03:52 -0700
committerGuenter Roeck <linux@roeck-us.net>2026-11-16 13:26:12 -0800
commite1d91be1ec2e68458d4e4eef33b0401016c54e26 (patch)
tree79656426da8acd8d2ed6f2e479e8c90082007516 /rust
parent9208893253e755b3acf2bc1af038d5c973cc3b45 (diff)
watchdog: core: Fix unbalanced module_put() in watchdog_open()
If the hardware watchdog is running (hw_running is true), try_module_get() is skipped. However, if watchdog_start() then fails, the code jumps to out_mod and unconditionally calls module_put(). This can cause a premature driver module unload while hardware timers or interrupts are active by dropping a reference that was never acquired. Only call module_put() if the hardware watchdog is not running to fix the problem. Reported-by: SashikoSashiko <sashiko@sashiko.dev> Link: https://sashiko.dev/#/bug/linux-64bd788f-a53c-4792-96ca-43b6c69c5fab Fixes: ee142889e32f ("watchdog: Introduce WDOG_HW_RUNNING flag") Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Link: https://patch.msgid.link/20261027160353.2519323-2-linux@roeck-us.net Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'rust')
0 files changed, 0 insertions, 0 deletions