diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 1d6b80145efb0..f9ccc42f9f24c 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -4486,6 +4486,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);