summaryrefslogtreecommitdiffstats
path: root/sys/kern/uipc_usrreq.c
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2008-01-18 19:16:03 +0000
committerrwatson <rwatson@FreeBSD.org>2008-01-18 19:16:03 +0000
commitdccd51b54f1c45d16ab33b729f947dd653d4a5eb (patch)
treea3160e45ff3d4d51c64f0a33b16045b18532808a /sys/kern/uipc_usrreq.c
parent3ccc28b1eaff0fc4dd1800b8f1e19e29b18d8e30 (diff)
downloadFreeBSD-src-dccd51b54f1c45d16ab33b729f947dd653d4a5eb.zip
FreeBSD-src-dccd51b54f1c45d16ab33b729f947dd653d4a5eb.tar.gz
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>
Diffstat (limited to 'sys/kern/uipc_usrreq.c')
-rw-r--r--sys/kern/uipc_usrreq.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c
index d60b270..f5ac25c 100644
--- a/sys/kern/uipc_usrreq.c
+++ b/sys/kern/uipc_usrreq.c
@@ -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);
OpenPOWER on IntegriCloud