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.
This commit is contained in:
cinap_lenrek 2018-10-27 20:00:12 +02:00
parent d81f4d4866
commit 2ee4c08974

View file

@ -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;