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:
parent
0e43e3b1b4
commit
4c9acdbfaf
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user