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