diff options
| author | Tzung-Bi Shih <tzungbi@kernel.org> | 2026-08-29 00:13:42 +0800 |
|---|---|---|
| committer | Guenter Roeck <linux@roeck-us.net> | 2026-09-09 14:09:29 -0700 |
| commit | 3db30f315935c2fb0d95f46b7a593b5b4d3ec3d0 (patch) | |
| tree | c5d7f904043accecd1e9a03e2141868caa49a61c /scripts/basic | |
| parent | 3c73a37f5e40972ce26d8eeb98e8b938d719b069 (diff) | |
| download | linux-3db30f315935c2fb0d95f46b7a593b5b4d3ec3d0.tar.gz linux-3db30f315935c2fb0d95f46b7a593b5b4d3ec3d0.zip | |
watchdog: msc313e: Fix clock leak and spurious timer in settimeout()
msc313e_wdt_settimeout() unconditionally calls msc313e_wdt_start() which
introduces two severe bugs:
1. If the watchdog is already active, calling start() again will
increase the reference count of the clock again. However stop() is
only called once, the reference count is unbalance.
2. If the watchdog is stopped, calling settimeout() will start
the hardware timer accidentally.
Factor out the register-writing logic into a helper function. Only call
it in settimeout() if the watchdog is running. Otherwise, simply update
`wdev->timeout`.
Fixes: e9800b799464 ("watchdog: Add Mstar MSC313e WDT driver")
Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
Link: https://patch.msgid.link/20260828161348.13212-4-tzungbi@kernel.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'scripts/basic')
0 files changed, 0 insertions, 0 deletions
