diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 69b8d707370844..eab9149a4f840e 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -4524,6 +4524,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);