shithub: riscv

Download patch

ref: f32ef135d4bce251f72275d30cfcd86cb188b8c9
parent: 3028437f8bbcbea7ec3007ed3fb7aed2a09763c3
author: cinap_lenrek <cinap_lenrek@centraldogma>
date: Mon Dec 12 14:28:21 EST 2011

devbridge: fix

--- a/sys/src/9/port/devbridge.c
+++ b/sys/src/9/port/devbridge.c
@@ -780,21 +780,15 @@
 	Centry *ce;
 	char c;
 
-	buf = smalloc(n);
 	qlock(b);
-	if(waserror()) {
-		qunlock(b);
-		free(buf);
-		nexterror();
-	}
 	sec = TK2SEC(m->ticks);
 	n = 0;
 	for(i=0; i<CacheSize; i++)
 		if(b->cache[i].expire != 0)
 			n++;
-	
 	n *= 51;	// change if print format is changed
 	n += 10;	// some slop at the end
+	buf = smalloc(n);
 	p = buf;
 	ep = buf + n;
 	ce = b->cache;
@@ -807,7 +801,6 @@
 			ce->port, ce->src, ce->dst, ce->expire+off, c);
 	}
 	*p = 0;
-	poperror();
 	qunlock(b);
 	return buf;
 }
--