[PATCH] Error in fdfree()

Skip Ford skip.ford at verizon.net
Sat Jan 17 09:41:13 PST 2004


I just ported the new FreeBSD fd code to DragonFly.  Their code
included this fix which looks like it should be applied to dfly
no matter what's decided about the rest of it.  As soon as I make
sure it compiles and boots (tomorrow probably) I'll post it to
kernel@ if others are interested.  But in the meantime this should
be applied I think.

Fix off-by-one error in fdfree().

Index: sys/kern/kern_descrip.c
===================================================================
RCS file: /home/dcvs/src/sys/kern/kern_descrip.c,v
retrieving revision 1.17
diff -u -r1.17 kern_descrip.c
--- sys/kern/kern_descrip.c	21 Oct 2003 01:05:09 -0000	1.17
+++ sys/kern/kern_descrip.c	17 Jan 2004 17:25:35 -0000
@@ -1117,7 +1117,7 @@
 			i = 0;
 			fpp = fdp->fd_ofiles;
 			for (i = 0, fpp = fdp->fd_ofiles;
-			     i < fdp->fd_lastfile;
+			     i <= fdp->fd_lastfile;
 			     i++, fpp++) {
 				if (*fpp == NULL ||
 				    (*fpp)->f_type != DTYPE_VNODE)

-- 
Skip





More information about the Submit mailing list