git: 9front

Download patch

ref: 19b1471823e5150cdb843ebb725802d9fe94ea14
parent: dbe0349879ec39513c6ea0a5de66016f2b8f8c06
author: cinap_lenrek <cinap_lenrek@rei2.9hal>
date: Sat Feb 4 11:41:46 EST 2012

devuart: fix no memory panic with zero number of uarts

--- a/sys/src/9/port/devuart.c
+++ b/sys/src/9/port/devuart.c
@@ -194,7 +194,7 @@
 
 	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, ".");
--