diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 5bdb3cd20d61..c9fe2c0b8cae 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -4564,7 +4564,7 @@ static bool skb_may_tx_timestamp(struct sock *sk, bool tsonly) { bool ret; - if (likely(sysctl_tstamp_allow_data || tsonly)) + if (likely(READ_ONCE(sysctl_tstamp_allow_data) || tsonly)) return true; read_lock_bh(&sk->sk_callback_lock);