Index: kern_descrip.c =================================================================== RCS file: /home/ncvs/src/sys/kern/kern_descrip.c,v retrieving revision 1.283 retrieving revision 1.284 diff -u -r1.283 -r1.284 --- kern_descrip.c 1 Nov 2005 17:13:05 -0000 1.283 +++ kern_descrip.c 9 Nov 2005 20:54:25 -0000 1.284 @@ -1880,9 +1880,13 @@ * a flag in the unlock to free ONLY locks obeying POSIX * semantics, and not to free BSD-style file locks. * If the descriptor was in a message, POSIX-style locks - * aren't passed with the descriptor. + * aren't passed with the descripto, and the thread pointer + * will be NULL. Callers should be careful only to pass a + * NULL thread pointer when there really is no owning + * context that might have locks, or the locks will be + * leaked. */ - if (fp->f_type == DTYPE_VNODE) { + if (fp->f_type == DTYPE_VNODE && td != NULL) { int vfslocked; vp = fp->f_vnode;