shithub: riscv

Download patch

ref: 89ed97aaa2ee0eae0042220de288ed02073d4878
parent: bf048d94c35c78081fa1a3cfdca8de16ad640325
author: ppatience0 <[email protected]>
date: Sun Jun 16 16:37:51 EDT 2013

nusb/ether: call sysfatal if dev is nil

--- a/sys/src/cmd/nusb/ether/ether.c
+++ b/sys/src/cmd/nusb/ether/ether.c
@@ -810,8 +810,9 @@
 	if(argc != 1)
 		usage();
 
-	d = getdev(atoi(*argv));
-	if(findendpoints(d, &ei, &eo)  < 0)
+	if((d = getdev(atoi(*argv))) == nil)
+		sysfatal("getdev: %r");
+	if(findendpoints(d, &ei, &eo) < 0)
 		sysfatal("no endpoints found");
 
 	werrstr("");