git: 9front

Download patch

ref: cc978d6fdb7e8ceddc92a7ed3f0f393f39c915e7
parent: 2bca65c495d86de07d72b64266089815b8a77901
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Fri Feb 20 13:56:22 EST 2015

devusb: check for nil hp->dump and hp->seprintep

--- a/sys/src/9/port/devusb.c
+++ b/sys/src/9/port/devusb.c
@@ -421,8 +421,10 @@
 			s = seprint(s, e, "ep%d.%d ", ep->dev->nb, ep->nb);
 			seprintep(s, e, ep, 1);
 			print("%s", buf);
-			ep->hp->seprintep(buf, e, ep);
-			print("%s", buf);
+			if(ep->hp->seprintep != nil){
+				ep->hp->seprintep(buf, e, ep);
+				print("%s", buf);
+			}
 			poperror();
 			putep(ep);
 		}
@@ -429,7 +431,7 @@
 	}
 	print("usb dump hcis:\n");
 	for(i = 0; i < Nhcis; i++)
-		if(hcis[i] != nil)
+		if(hcis[i] != nil && hcis[i]->dump != nil)
 			hcis[i]->dump(hcis[i]);
 }
 
--