Skip to content

Commit

Permalink
xfrm: Use rcu_dereference_bh to deference pointer protected by rcu_re…
Browse files Browse the repository at this point in the history
…ad_lock_bh

Signed-off-by: Fan Du <fan.du@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Fan Du authored and David S. Miller committed Aug 17, 2012
1 parent 02644a1 commit 5689226
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/xfrm/xfrm_policy.c
Original file line number Diff line number Diff line change
Expand Up @@ -2501,11 +2501,11 @@ static void __net_init xfrm_dst_ops_init(struct net *net)
struct xfrm_policy_afinfo *afinfo;

rcu_read_lock_bh();
afinfo = rcu_dereference(xfrm_policy_afinfo[AF_INET]);
afinfo = rcu_dereference_bh(xfrm_policy_afinfo[AF_INET]);
if (afinfo)
net->xfrm.xfrm4_dst_ops = *afinfo->dst_ops;
#if IS_ENABLED(CONFIG_IPV6)
afinfo = rcu_dereference(xfrm_policy_afinfo[AF_INET6]);
afinfo = rcu_dereference_bh(xfrm_policy_afinfo[AF_INET6]);
if (afinfo)
net->xfrm.xfrm6_dst_ops = *afinfo->dst_ops;
#endif
Expand Down

0 comments on commit 5689226

Please sign in to comment.