# HG changeset patch # User John Floren # Date 1328314832 0 # Node ID 1bb8d98bed2dbc9870056e0a82e6367ee102d2bd # Parent ef374a94a139ac50f9a074076a6f6919003d1782 devuart.c: This prevents the "no memory" panic I saw on the T61. R=nix-dev, rminnich, nemo CC=nix-dev http://codereview.appspot.com/5569047 diff -r ef374a94a139 -r 1bb8d98bed2d sys/src/nix/port/devuart.c --- a/sys/src/nix/port/devuart.c Fri Feb 03 18:53:25 2012 +0000 +++ b/sys/src/nix/port/devuart.c Sat Feb 04 00:20:32 2012 +0000 @@ -197,7 +197,7 @@ uartndir = 1 + 3*uartnuart; uartdir = malloc(uartndir * sizeof(Dirtab)); - if(uart == nil || uartdir == nil) + if(uartnuart > 0 && uart == nil || uartdir == nil) panic("uartreset: no memory"); dp = uartdir; strcpy(dp->name, ".");