On 8/15/19 6:00 PM, Davide Caratti wrote:

>  
> +     if (net_admin) {
> +             const struct tcp_ulp_ops *ulp_ops;
> +
> +             rcu_read_lock();
> +             ulp_ops = icsk->icsk_ulp_ops;
> +             if (ulp_ops)
> +                     err = tcp_diag_put_ulp(skb, sk, ulp_ops);
> +             rcu_read_unlock();
> +             if (err)
> +                     return err;
> +     }
>       return 0;


Why is rcu_read_lock() and rcu_read_unlock() used at all ?

icsk->icsk_ulp_ops does not seem to be rcu protected ?

If this was, then an rcu_dereference() would be appropriate.

Reply via email to