Move unlock of global UNIX domain socket lock slightly lower in

unp_connect(): it is expected to return with the lock held, and two
possible error paths otherwise returned with it unlocked.

The fix committed here is slightly different from the patch in the
PR, but along an alternative line suggested in the PR.

PR:		119778
MFC after:	3 days
Submitted by:	James Juran <james dot juran at baesystems dot com>
This commit is contained in:
rwatson 2008-01-18 19:16:03 +00:00
parent 3ccc28b1ea
commit dccd51b54f

View File

@ -1122,7 +1122,6 @@ unp_connect(struct socket *so, struct sockaddr *nam, struct thread *td)
struct sockaddr *sa;
UNP_GLOBAL_WLOCK_ASSERT();
UNP_GLOBAL_WUNLOCK();
unp = sotounpcb(so);
KASSERT(unp != NULL, ("unp_connect: unp == NULL"));
@ -1137,6 +1136,7 @@ unp_connect(struct socket *so, struct sockaddr *nam, struct thread *td)
UNP_PCB_UNLOCK(unp);
return (EALREADY);
}
UNP_GLOBAL_WUNLOCK();
unp->unp_flags |= UNP_CONNECTING;
UNP_PCB_UNLOCK(unp);