devuart: fix no memory panic with zero number of uarts

This commit is contained in:
cinap_lenrek 2012-02-04 16:41:46 +01:00
parent 25493360e3
commit 8d22d0b165

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