From 2ee4c089741823aae794eaa2eb53780f65019981 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Sat, 27 Oct 2018 20:00:12 +0200 Subject: [PATCH] devuart: don't sleep in uartdrainoutput() when called splhi or without a process uartdrainoutput() might be called in early initialization from uartctl() without a process. --- sys/src/9/port/devuart.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/src/9/port/devuart.c b/sys/src/9/port/devuart.c index 197e695f4..6cc9c46d8 100644 --- a/sys/src/9/port/devuart.c +++ b/sys/src/9/port/devuart.c @@ -318,9 +318,8 @@ uartdrained(void* arg) static void uartdrainoutput(Uart *p) { - if(!p->enabled) + if(!p->enabled || up == nil || !islo()) return; - p->drain = 1; if(waserror()){ p->drain = 0;