summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/kern/uipc_syscalls.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c
index 8deefe5..ec545b1 100644
--- a/sys/kern/uipc_syscalls.c
+++ b/sys/kern/uipc_syscalls.c
@@ -351,9 +351,8 @@ accept1(td, uap, compat)
* reference count. Otherwise, if the protocol calls sofree(),
* the socket will be released due to a zero refcount.
*/
- SOCK_LOCK(so);
+ SOCK_LOCK(so); /* soref() and so_state update */
soref(so); /* file descriptor reference */
- SOCK_UNLOCK(so);
TAILQ_REMOVE(&head->so_comp, so, so_list);
head->so_qlen--;
@@ -361,6 +360,7 @@ accept1(td, uap, compat)
so->so_qstate &= ~SQ_COMP;
so->so_head = NULL;
+ SOCK_UNLOCK(so);
ACCEPT_UNLOCK();
/* An extra reference on `nfp' has been held for us by falloc(). */
OpenPOWER on IntegriCloud