From cff2dcd10d65cd91e83860650a8cb1afcc5e4910 Mon Sep 17 00:00:00 2001 From: Pawel Jakub Dawidek Date: Sat, 16 Jun 2012 12:56:36 +0000 Subject: [PATCH] Revert r237073. 'td' can be NULL here. MFC after: 1 month --- sys/kern/kern_descrip.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index fea1eb7fa3e..f5106e14f9b 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -2104,9 +2104,6 @@ closef(struct file *fp, struct thread *td) struct filedesc *fdp; struct file *fp_object; - fdp = td->td_proc->p_fd; - FILEDESC_UNLOCK_ASSERT(fdp); - /* * POSIX record locking dictates that any close releases ALL * locks owned by this process. This is handled by setting @@ -2142,6 +2139,7 @@ closef(struct file *fp, struct thread *td) * Handle special case where file descriptor table is * shared between multiple process leaders. */ + fdp = td->td_proc->p_fd; FILEDESC_XLOCK(fdp); for (fdtol = fdtol->fdl_next; fdtol != td->td_proc->p_fdtol;