diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 53bcc17c91e4c4..0786134ce31435 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -4463,6 +4463,8 @@ void tcp_done(struct sock *sk) */ req = rcu_dereference_protected(tcp_sk(sk)->fastopen_rsk, 1); + WARN_ON_ONCE(sk->sk_state == TCP_CLOSE); + if (sk->sk_state == TCP_SYN_SENT || sk->sk_state == TCP_SYN_RECV) TCP_INC_STATS(sock_net(sk), TCP_MIB_ATTEMPTFAILS);