diff options
-rw-r--r-- | sys/kern/kern_cons.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/kern/kern_cons.c b/sys/kern/kern_cons.c index a3267e3..dfb832e 100644 --- a/sys/kern/kern_cons.c +++ b/sys/kern/kern_cons.c @@ -505,6 +505,13 @@ cnputs(char *p) int unlock_reqd = 0; if (use_cnputs_mtx) { + /* + * NOTE: Debug prints and/or witness printouts in + * console driver clients can cause the "cnputs_mtx" + * mutex to recurse. Simply return if that happens. + */ + if (mtx_owned(&cnputs_mtx)) + return; mtx_lock_spin(&cnputs_mtx); unlock_reqd = 1; } |