summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2004-03-29 17:57:43 +0000
committerrwatson <rwatson@FreeBSD.org>2004-03-29 17:57:43 +0000
commit4edcdd352b9284794c47da3a22079b8ee0b1c232 (patch)
tree9febe822ab6feeb230cb09774de19635148d522f
parentf31d09974779144113570ae1799c033ad751cf98 (diff)
downloadFreeBSD-src-4edcdd352b9284794c47da3a22079b8ee0b1c232.zip
FreeBSD-src-4edcdd352b9284794c47da3a22079b8ee0b1c232.tar.gz
In sofree(), moving caching of 'head' from 'so->so_head' to later in
the function once it has been determined to be non-NULL to simplify locking on an earlier return.
-rw-r--r--sys/kern/uipc_socket.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c
index 8bd487d..fc7ef8b 100644
--- a/sys/kern/uipc_socket.c
+++ b/sys/kern/uipc_socket.c
@@ -283,14 +283,14 @@ void
sofree(so)
struct socket *so;
{
- struct socket *head = so->so_head;
int s;
KASSERT(so->so_count == 0, ("socket %p so_count not 0", so));
if (so->so_pcb || (so->so_state & SS_NOFDREF) == 0)
return;
- if (head != NULL) {
+ if (so->so_head != NULL) {
+ struct socket *head = so->so_head;
if (so->so_state & SS_INCOMP) {
TAILQ_REMOVE(&head->so_incomp, so, so_list);
head->so_incqlen--;
OpenPOWER on IntegriCloud