In uipc_connect(), assert that the passed thread is curthread, and pass

td into unp_connect() instead of reading curthread.
This commit is contained in:
rwatson 2004-07-25 23:30:43 +00:00
parent 0e43e3b1b4
commit 4c9acdbfaf
2 changed files with 4 additions and 1 deletions

View File

@ -736,6 +736,7 @@ turnstile_unpend(struct turnstile *ts)
td->td_lockname = NULL;
TD_CLR_LOCK(td);
MPASS(TD_CAN_RUN(td));
MPASS(td->td_turnstile != NULL);
setrunqueue(td);
} else {
td->td_flags |= TDF_TSNOBLOCK;

View File

@ -171,10 +171,12 @@ uipc_connect(struct socket *so, struct sockaddr *nam, struct thread *td)
struct unpcb *unp = sotounpcb(so);
int error;
KASSERT(td == curthread, ("uipc_connect: td != curthread"));
if (unp == NULL)
return (EINVAL);
UNP_LOCK();
error = unp_connect(so, nam, curthread);
error = unp_connect(so, nam, td);
UNP_UNLOCK();
return (error);
}