Commit 56892261 authored by Fan Du's avatar Fan Du Committed by David S. Miller

xfrm: Use rcu_dereference_bh to deference pointer protected by rcu_read_lock_bh

Signed-off-by: default avatarFan Du <fan.du@windriver.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 02644a17
...@@ -2501,11 +2501,11 @@ static void __net_init xfrm_dst_ops_init(struct net *net) ...@@ -2501,11 +2501,11 @@ static void __net_init xfrm_dst_ops_init(struct net *net)
struct xfrm_policy_afinfo *afinfo; struct xfrm_policy_afinfo *afinfo;
rcu_read_lock_bh(); rcu_read_lock_bh();
afinfo = rcu_dereference(xfrm_policy_afinfo[AF_INET]); afinfo = rcu_dereference_bh(xfrm_policy_afinfo[AF_INET]);
if (afinfo) if (afinfo)
net->xfrm.xfrm4_dst_ops = *afinfo->dst_ops; net->xfrm.xfrm4_dst_ops = *afinfo->dst_ops;
#if IS_ENABLED(CONFIG_IPV6) #if IS_ENABLED(CONFIG_IPV6)
afinfo = rcu_dereference(xfrm_policy_afinfo[AF_INET6]); afinfo = rcu_dereference_bh(xfrm_policy_afinfo[AF_INET6]);
if (afinfo) if (afinfo)
net->xfrm.xfrm6_dst_ops = *afinfo->dst_ops; net->xfrm.xfrm6_dst_ops = *afinfo->dst_ops;
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment