diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 9a8b134d8ada9..b67fa6f9d1972 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -4519,6 +4519,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);