shithub: riscv

Download patch

ref: 4a6939c2ceaae436d8595b45c42d531faff7fac5
parent: 4abb38f1778a60e8d3ae14af928b0192ff3a5ed2
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Fri Mar 21 14:12:06 EDT 2014

devfs: fix cclose() crash in devfs error handling

--- a/sys/src/9/port/devfs.c
+++ b/sys/src/9/port/devfs.c
@@ -646,7 +646,7 @@
 Fail:
 		for(i = 1; i < cb->nf; i++)
 			if(idev != nil && idev[i-1] != nil)
-				cclose(idev[i]);
+				cclose(idev[i-1]);
 		if(mp != nil)
 			mdeldev(mp);
 		free(idev);