From 52e64db00e63d6005af3b23b794141b992153506 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fran=C3=A7ois=20Tigeot?= Date: Thu, 3 May 2012 12:43:52 +0200 Subject: [PATCH] Kernel: do not manipulate watchdog list if empty Suggested-by: Alex Hornung --- sys/kern/kern_wdog.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/kern/kern_wdog.c b/sys/kern/kern_wdog.c index 7010eb05c9..f09f4d0221 100644 --- a/sys/kern/kern_wdog.c +++ b/sys/kern/kern_wdog.c @@ -95,6 +95,8 @@ wdog_reset_all(void *unused) int period, min_period = INT_MAX; spin_lock(&wdogmtx); + if (LIST_EMPTY(&wdoglist)) + goto done; LIST_FOREACH(wd, &wdoglist, link) { period = wdog_reset(wd); if (period < min_period) @@ -105,6 +107,7 @@ wdog_reset_all(void *unused) wdog_auto_period = min_period; +done: spin_unlock(&wdogmtx); } -- 2.41.0