mptcp: fix splat when closing unaccepted socket
[linux-2.6-microblaze.git] / net / mptcp / subflow.c
index 82e91b0..a5ede35 100644 (file)
@@ -546,8 +546,7 @@ static void mptcp_sock_destruct(struct sock *sk)
         * ESTABLISHED state and will not have the SOCK_DEAD flag.
         * Both result in warnings from inet_sock_destruct.
         */
-
-       if (sk->sk_state == TCP_ESTABLISHED) {
+       if ((1 << sk->sk_state) & (TCPF_ESTABLISHED | TCPF_CLOSE_WAIT)) {
                sk->sk_state = TCP_CLOSE;
                WARN_ON_ONCE(sk->sk_socket);
                sock_orphan(sk);