In sofree(), avoid nested declaration and initialization in

declaration.  Observe that initialization in declaration is
frequently incompatible with locking, not just a bad idea
due to style(9).

Submitted by:	bde
This commit is contained in:
Robert Watson 2004-03-31 03:48:35 +00:00
parent 0c22b2b981
commit 8e44a7ec13

View File

@ -283,6 +283,7 @@ void
sofree(so)
struct socket *so;
{
struct socket *head;
int s;
KASSERT(so->so_count == 0, ("socket %p so_count not 0", so));
@ -290,7 +291,7 @@ sofree(so)
if (so->so_pcb || (so->so_state & SS_NOFDREF) == 0)
return;
if (so->so_head != NULL) {
struct socket *head = so->so_head;
head = so->so_head;
if (so->so_state & SS_INCOMP) {
TAILQ_REMOVE(&head->so_incomp, so, so_list);
head->so_incqlen--;