devuart: fix no memory panic with zero number of uarts

front
cinap_lenrek 2012-02-04 16:41:46 +01:00
parent 25493360e3
commit 8d22d0b165
1 changed files with 1 additions and 1 deletions

View File

@ -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, ".");