Index: sys/fs/procfs/procfs_ioctl.c =================================================================== RCS file: /home/ncvs/src/sys/fs/procfs/procfs_ioctl.c,v retrieving revision 1.16 diff -u -r1.16 procfs_ioctl.c --- sys/fs/procfs/procfs_ioctl.c 19 Feb 2007 13:04:25 -0000 1.16 +++ sys/fs/procfs/procfs_ioctl.c 1 May 2007 10:26:17 -0000 @@ -70,7 +70,10 @@ int ival; #endif - PROC_LOCK(p); + KASSERT(p != NULL, + ("%s() called without a process", __func__)); + PROC_LOCK_ASSERT(p, MA_OWNED); + error = 0; switch (cmd) { #if defined(COMPAT_FREEBSD5) || defined(COMPAT_FREEBSD4) || defined(COMPAT_43) @@ -193,7 +196,6 @@ default: error = (ENOTTY); } - PROC_UNLOCK(p); return (error); }