Revert r237073. 'td' can be NULL here.

MFC after:	1 month
This commit is contained in:
pjd 2012-06-16 12:56:36 +00:00
parent 0fde851506
commit 9719a38d39

View File

@ -2104,9 +2104,6 @@ closef(struct file *fp, struct thread *td)
struct filedesc *fdp; struct filedesc *fdp;
struct file *fp_object; struct file *fp_object;
fdp = td->td_proc->p_fd;
FILEDESC_UNLOCK_ASSERT(fdp);
/* /*
* POSIX record locking dictates that any close releases ALL * POSIX record locking dictates that any close releases ALL
* locks owned by this process. This is handled by setting * 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 * Handle special case where file descriptor table is
* shared between multiple process leaders. * shared between multiple process leaders.
*/ */
fdp = td->td_proc->p_fd;
FILEDESC_XLOCK(fdp); FILEDESC_XLOCK(fdp);
for (fdtol = fdtol->fdl_next; for (fdtol = fdtol->fdl_next;
fdtol != td->td_proc->p_fdtol; fdtol != td->td_proc->p_fdtol;