mirror of
https://github.com/torvalds/linux.git
synced 2026-09-12 20:53:03 +02:00
watchdog: fix hrtimer start when pretimeout is zero
Per the watchdog API, a pretimeout value of 0 disables the feature.
However, watchdog_hrtimer_pretimeout_start() fails to verify if the
pretimeout is non-zero before arming the timer.
This omission inadvertently starts the software pretimeout timer,
which could result in the pretimeout handler executing incorrectly
when the watchdog timeout is reached.
Fix this by adding a check for wdd->pretimeout before calling
hrtimer_start(), ensuring the disabled state is respected.
Fixes: 7b7d2fdc8c ("watchdog: Add hrtimer-based pretimeout feature")
Signed-off-by: David Arcari <darcari@redhat.com>
Link: https://patch.msgid.link/20260903182029.936030-1-darcari@redhat.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
This commit is contained in:
parent
d83b7502bb
commit
0fa37512eb
|
|
@ -30,6 +30,7 @@ void watchdog_hrtimer_pretimeout_init(struct watchdog_device *wdd)
|
|||
void watchdog_hrtimer_pretimeout_start(struct watchdog_device *wdd)
|
||||
{
|
||||
if (!(wdd->info->options & WDIOF_PRETIMEOUT) &&
|
||||
wdd->pretimeout &&
|
||||
!watchdog_pretimeout_invalid(wdd, wdd->pretimeout))
|
||||
hrtimer_start(&wdd->wd_data->pretimeout_timer,
|
||||
ktime_set(wdd->timeout - wdd->pretimeout, 0),
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user