Skip to content

Commit

Permalink
netrom: Kill spurious NULL'ing of sk->sk_socket.
Browse files Browse the repository at this point in the history
In nr_release(), one code path calls sock_orphan() which
will NULL out sk->sk_socket already.

In the other case, handling states other than NR_STATE_{0,1,2,3},
seems to not be possible other than due to bugs.  Even for an
uninitialized nr->state value, that would be zero or NR_STATE_0.
It might be wise to stick a WARN_ON() here.

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Jun 17, 2008
1 parent c751e4f commit 48c5732
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions net/netrom/af_netrom.c
Original file line number Diff line number Diff line change
Expand Up @@ -536,11 +536,9 @@ static int nr_release(struct socket *sock)
sk->sk_state_change(sk);
sock_orphan(sk);
sock_set_flag(sk, SOCK_DESTROY);
sk->sk_socket = NULL;
break;

default:
sk->sk_socket = NULL;
break;
}

Expand Down

0 comments on commit 48c5732

Please sign in to comment.