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.
This commit is contained in:
rwatson 2004-03-29 17:57:43 +00:00
parent f31d099747
commit 4edcdd352b

View File

@ -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--;