diff --git a/net/ipv4/tcp_ao.c b/net/ipv4/tcp_ao.c index 85531437890cee..5ce914d3e3db5c 100644 --- a/net/ipv4/tcp_ao.c +++ b/net/ipv4/tcp_ao.c @@ -267,6 +267,14 @@ static void tcp_ao_key_free_rcu(struct rcu_head *head) kfree_sensitive(key); } +static void tcp_ao_info_free_rcu(struct rcu_head *head) +{ + struct tcp_ao_info *ao = container_of(head, struct tcp_ao_info, rcu); + + kfree(ao); + static_branch_slow_dec_deferred(&tcp_ao_needed); +} + void tcp_ao_destroy_sock(struct sock *sk, bool twsk) { struct tcp_ao_info *ao; @@ -290,9 +298,7 @@ void tcp_ao_destroy_sock(struct sock *sk, bool twsk) atomic_sub(tcp_ao_sizeof_key(key), &sk->sk_omem_alloc); call_rcu(&key->rcu, tcp_ao_key_free_rcu); } - - kfree_rcu(ao, rcu); - static_branch_slow_dec_deferred(&tcp_ao_needed); + call_rcu(&ao->rcu, tcp_ao_info_free_rcu); } void tcp_ao_time_wait(struct tcp_timewait_sock *tcptw, struct tcp_sock *tp)