diff options
author | cinap_lenrek <cinap_lenrek@rei2.9hal> | 2012-02-04 16:41:46 +0100 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@rei2.9hal> | 2012-02-04 16:41:46 +0100 |
commit | 8d22d0b165ff3bc226f9027c1ecf82b34cd21cef (patch) | |
tree | 6c60f5d9d8663d7158640d8633399cb1fc8d4f63 /sys/src/9/port/devuart.c | |
parent | 25493360e37474fb656eb8eea336e80bf3e99c66 (diff) |
devuart: fix no memory panic with zero number of uarts
Diffstat (limited to 'sys/src/9/port/devuart.c')
-rw-r--r-- | sys/src/9/port/devuart.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/src/9/port/devuart.c b/sys/src/9/port/devuart.c index df5d515a4..62f42ac17 100644 --- a/sys/src/9/port/devuart.c +++ b/sys/src/9/port/devuart.c @@ -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, "."); |