⬢ DragonFlyBSD Kernel Audit
DF-5628 / fix.diff
← back to finding ↓ download raw
--- a/sys/bus/ppbus/ppb_base.c	2026-10-08 23:00:10.320518500 +0000
+++ b/sys/bus/ppbus/ppb_base.c	2026-10-08 23:00:23.688345817 +0000
@@ -74,14 +74,17 @@
 		switch (how) {
 		case PPB_NOINTR:
 			/* wait 10 ms */
-			tsleep((caddr_t)bus, 0, "ppbpoll", hz/100);
+			/* imax(): with a boot tunable kern.hz < 100 the
+			 * raw quotient is 0 and tsleep() would arm NO
+			 * timeout at all (kern_synch.c: `if (timo)') */
+			tsleep((caddr_t)bus, 0, "ppbpoll", imax(1, hz/100));
 			break;
 
 		case PPB_INTR:
 		default:
 			/* wait 10 ms */
 			if (((error = tsleep((caddr_t)bus, PCATCH,
-			    "ppbpoll", hz/100)) != EWOULDBLOCK) != 0) {
+			    "ppbpoll", imax(1, hz/100))) != EWOULDBLOCK) != 0) {
 				return (error);
 			}
 			break;