diff --git a/net/tipc/socket.c b/net/tipc/socket.c index c9c34a6679213e61c19cb6f691d7173776315369..720fda6cc2e6223771f3df5b21885cb10d5c7b2d 100644 --- a/net/tipc/socket.c +++ b/net/tipc/socket.c @@ -470,8 +470,8 @@ static void tipc_sk_callback(struct rcu_head *head) static int tipc_release(struct socket *sock) { struct sock *sk = sock->sk; - struct net *net = sock_net(sk); - struct tipc_net *tn = net_generic(net, tipc_net_id); + struct net *net; + struct tipc_net *tn; struct tipc_sock *tsk; struct sk_buff *skb; u32 dnode, probing_state; @@ -483,6 +483,9 @@ static int tipc_release(struct socket *sock) if (sk == NULL) return 0; + net = sock_net(sk); + tn = net_generic(net, tipc_net_id); + tsk = tipc_sk(sk); lock_sock(sk);