xfrm: Use rcu_dereference_bh to deference pointer protected by rcu_read_lock_bh
authorFan Du <fan.du@windriver.com>
Thu, 16 Aug 2012 09:51:25 +0000 (17:51 +0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 17 Aug 2012 02:39:22 +0000 (19:39 -0700)
Signed-off-by: Fan Du <fan.du@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/xfrm/xfrm_policy.c

index 5ad4d2c4b83c5ca1fb58ff719c516b710ba2ef96..6405764eaa82aeec79763f60974c90674214f3a8 100644 (file)
@@ -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