DragonFlyBSD Kernel Audit
DF-1890 / fix.diff
← back to finding ↓ download raw
diff --git a/sys/dev/misc/amdsbwd/amdsbwd.c b/sys/dev/misc/amdsbwd/amdsbwd.c
--- a/sys/dev/misc/amdsbwd/amdsbwd.c
+++ b/sys/dev/misc/amdsbwd/amdsbwd.c
@@ -214,7 +214,7 @@
 	unsigned int timeout;
 	struct amdsbwd_softc *sc = arg;
 
-	timeout = (period * 1000) / sc->ms_per_tick;
+	timeout = ((u_int64_t)period * 1000) / sc->ms_per_tick;
 	if (timeout > sc->max_ticks)
 		timeout = sc->max_ticks;
 	if (timeout != sc->timeout) {
@@ -515,7 +515,7 @@
 	sc->wdog.name = "AMD southbridge";
 	sc->wdog.wdog_fn = amdsb_watchdog;
 	sc->wdog.arg = sc;
-	sc->wdog.period_max = (UINT16_MAX*1000) / 10;
+	sc->wdog.period_max = (UINT16_MAX*1000) / sc->ms_per_tick;
 	wdog_register(&sc->wdog);
 
 	return (0);