devuart: fix no memory panic with zero number of uarts
parent
25493360e3
commit
8d22d0b165
|
@ -194,7 +194,7 @@ uartreset(void)
|
|||
|
||||
uartndir = 1 + 3*uartnuart;
|
||||
uartdir = xalloc(uartndir * sizeof(Dirtab));
|
||||
if (uart == nil || uartdir == nil)
|
||||
if(uartnuart && uart == nil || uartdir == nil)
|
||||
panic("uartreset: no memory");
|
||||
dp = uartdir;
|
||||
strcpy(dp->name, ".");
|
||||
|
|
Loading…
Reference in New Issue