]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
netrom: Kill spurious NULL'ing of sk->sk_socket.
authorDavid S. Miller <davem@davemloft.net>
Tue, 17 Jun 2008 10:19:58 +0000 (03:19 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 17 Jun 2008 10:19:58 +0000 (03:19 -0700)
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>
net/netrom/af_netrom.c

index 58779624cdbec7f2fb990f25c73dfbbbec971e91..74884f4a62550af824bf2e2e99a5c14654028398 100644 (file)
@@ -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;
        }