提交 48c5732f 编写于 作者: D David S. Miller

netrom: Kill spurious NULL'ing of sk->sk_socket.

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: NDavid S. Miller <davem@davemloft.net>
上级 c751e4f8
...@@ -536,11 +536,9 @@ static int nr_release(struct socket *sock) ...@@ -536,11 +536,9 @@ static int nr_release(struct socket *sock)
sk->sk_state_change(sk); sk->sk_state_change(sk);
sock_orphan(sk); sock_orphan(sk);
sock_set_flag(sk, SOCK_DESTROY); sock_set_flag(sk, SOCK_DESTROY);
sk->sk_socket = NULL;
break; break;
default: default:
sk->sk_socket = NULL;
break; break;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册