From 71c90a29443c999b7e8a03e2a3140c075dba547e Mon Sep 17 00:00:00 2001 From: Robert Watson Date: Mon, 29 Mar 2004 17:57:43 +0000 Subject: [PATCH] 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. --- sys/kern/uipc_socket.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 8bd487d57a9..fc7ef8bd9ef 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--;