Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

rcu: convert uses of rcu_assign_pointer(x, NULL) to RCU_INIT_POINTER

When assigning a NULL value to an RCU protected pointer, no barrier
is needed. The rcu_assign_pointer, used to handle that but will soon
change to not handle the special case.

Convert all rcu_assign_pointer of NULL value.

//smpl
@@ expression P; @@

- rcu_assign_pointer(P, NULL)
+ RCU_INIT_POINTER(P, NULL)

// </smpl>

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Stephen Hemminger and committed by
David S. Miller
a9b3cd7f 76f793e3

+193 -193
+2 -2
net/802/garp.c
··· 553 553 if (rtnl_dereference(port->applicants[i])) 554 554 return; 555 555 } 556 - rcu_assign_pointer(dev->garp_port, NULL); 556 + RCU_INIT_POINTER(dev->garp_port, NULL); 557 557 kfree_rcu(port, rcu); 558 558 } 559 559 ··· 605 605 606 606 ASSERT_RTNL(); 607 607 608 - rcu_assign_pointer(port->applicants[appl->type], NULL); 608 + RCU_INIT_POINTER(port->applicants[appl->type], NULL); 609 609 610 610 /* Delete timer and generate a final TRANSMIT_PDU event to flush out 611 611 * all pending messages before the applicant is gone. */
+2 -2
net/802/stp.c
··· 88 88 { 89 89 mutex_lock(&stp_proto_mutex); 90 90 if (is_zero_ether_addr(proto->group_address)) 91 - rcu_assign_pointer(stp_proto, NULL); 91 + RCU_INIT_POINTER(stp_proto, NULL); 92 92 else 93 - rcu_assign_pointer(garp_protos[proto->group_address[5] - 93 + RCU_INIT_POINTER(garp_protos[proto->group_address[5] - 94 94 GARP_ADDR_MIN], NULL); 95 95 synchronize_rcu(); 96 96
+1 -1
net/8021q/vlan.c
··· 133 133 if (grp->nr_vlans == 0) { 134 134 vlan_gvrp_uninit_applicant(real_dev); 135 135 136 - rcu_assign_pointer(real_dev->vlgrp, NULL); 136 + RCU_INIT_POINTER(real_dev->vlgrp, NULL); 137 137 138 138 /* Free the group, after all cpu's are done. */ 139 139 call_rcu(&grp->rcu, vlan_rcu_free);
+2 -2
net/bridge/netfilter/ebtable_broute.c
··· 87 87 if (ret < 0) 88 88 return ret; 89 89 /* see br_input.c */ 90 - rcu_assign_pointer(br_should_route_hook, 90 + RCU_INIT_POINTER(br_should_route_hook, 91 91 (br_should_route_hook_t *)ebt_broute); 92 92 return 0; 93 93 } 94 94 95 95 static void __exit ebtable_broute_fini(void) 96 96 { 97 - rcu_assign_pointer(br_should_route_hook, NULL); 97 + RCU_INIT_POINTER(br_should_route_hook, NULL); 98 98 synchronize_net(); 99 99 unregister_pernet_subsys(&broute_net_ops); 100 100 }
+3 -3
net/caif/cfmuxl.c
··· 108 108 int idx = phyid % DN_CACHE_SIZE; 109 109 110 110 spin_lock_bh(&muxl->transmit_lock); 111 - rcu_assign_pointer(muxl->dn_cache[idx], NULL); 111 + RCU_INIT_POINTER(muxl->dn_cache[idx], NULL); 112 112 dn = get_from_id(&muxl->frml_list, phyid); 113 113 if (dn == NULL) 114 114 goto out; ··· 164 164 if (up == NULL) 165 165 goto out; 166 166 167 - rcu_assign_pointer(muxl->up_cache[idx], NULL); 167 + RCU_INIT_POINTER(muxl->up_cache[idx], NULL); 168 168 list_del_rcu(&up->node); 169 169 out: 170 170 spin_unlock_bh(&muxl->receive_lock); ··· 261 261 262 262 idx = layer->id % UP_CACHE_SIZE; 263 263 spin_lock_bh(&muxl->receive_lock); 264 - rcu_assign_pointer(muxl->up_cache[idx], NULL); 264 + RCU_INIT_POINTER(muxl->up_cache[idx], NULL); 265 265 list_del_rcu(&layer->node); 266 266 spin_unlock_bh(&muxl->receive_lock); 267 267 }
+2 -2
net/can/af_can.c
··· 719 719 proto); 720 720 err = -EBUSY; 721 721 } else 722 - rcu_assign_pointer(proto_tab[proto], cp); 722 + RCU_INIT_POINTER(proto_tab[proto], cp); 723 723 724 724 mutex_unlock(&proto_tab_lock); 725 725 ··· 740 740 741 741 mutex_lock(&proto_tab_lock); 742 742 BUG_ON(proto_tab[proto] != cp); 743 - rcu_assign_pointer(proto_tab[proto], NULL); 743 + RCU_INIT_POINTER(proto_tab[proto], NULL); 744 744 mutex_unlock(&proto_tab_lock); 745 745 746 746 synchronize_rcu();
+2 -2
net/core/dev.c
··· 3094 3094 { 3095 3095 3096 3096 ASSERT_RTNL(); 3097 - rcu_assign_pointer(dev->rx_handler, NULL); 3098 - rcu_assign_pointer(dev->rx_handler_data, NULL); 3097 + RCU_INIT_POINTER(dev->rx_handler, NULL); 3098 + RCU_INIT_POINTER(dev->rx_handler_data, NULL); 3099 3099 } 3100 3100 EXPORT_SYMBOL_GPL(netdev_rx_handler_unregister); 3101 3101
+1 -1
net/core/fib_rules.c
··· 487 487 if (ops->nr_goto_rules > 0) { 488 488 list_for_each_entry(tmp, &ops->rules_list, list) { 489 489 if (rtnl_dereference(tmp->ctarget) == rule) { 490 - rcu_assign_pointer(tmp->ctarget, NULL); 490 + RCU_INIT_POINTER(tmp->ctarget, NULL); 491 491 ops->unresolved_rules++; 492 492 } 493 493 }
+1 -1
net/core/filter.c
··· 645 645 filter = rcu_dereference_protected(sk->sk_filter, 646 646 sock_owned_by_user(sk)); 647 647 if (filter) { 648 - rcu_assign_pointer(sk->sk_filter, NULL); 648 + RCU_INIT_POINTER(sk->sk_filter, NULL); 649 649 sk_filter_uncharge(sk, filter); 650 650 ret = 0; 651 651 }
+2 -2
net/core/net-sysfs.c
··· 987 987 } 988 988 989 989 if (nonempty) 990 - rcu_assign_pointer(dev->xps_maps, new_dev_maps); 990 + RCU_INIT_POINTER(dev->xps_maps, new_dev_maps); 991 991 else { 992 992 kfree(new_dev_maps); 993 - rcu_assign_pointer(dev->xps_maps, NULL); 993 + RCU_INIT_POINTER(dev->xps_maps, NULL); 994 994 } 995 995 996 996 if (dev_maps)
+2 -2
net/core/netpoll.c
··· 760 760 } 761 761 762 762 /* last thing to do is link it to the net device structure */ 763 - rcu_assign_pointer(ndev->npinfo, npinfo); 763 + RCU_INIT_POINTER(ndev->npinfo, npinfo); 764 764 765 765 return 0; 766 766 ··· 901 901 if (ops->ndo_netpoll_cleanup) 902 902 ops->ndo_netpoll_cleanup(np->dev); 903 903 904 - rcu_assign_pointer(np->dev->npinfo, NULL); 904 + RCU_INIT_POINTER(np->dev->npinfo, NULL); 905 905 906 906 /* avoid racing with NAPI reading npinfo */ 907 907 synchronize_rcu_bh();
+2 -2
net/core/sock.c
··· 387 387 388 388 if (dst && dst->obsolete && dst->ops->check(dst, cookie) == NULL) { 389 389 sk_tx_queue_clear(sk); 390 - rcu_assign_pointer(sk->sk_dst_cache, NULL); 390 + RCU_INIT_POINTER(sk->sk_dst_cache, NULL); 391 391 dst_release(dst); 392 392 return NULL; 393 393 } ··· 1158 1158 atomic_read(&sk->sk_wmem_alloc) == 0); 1159 1159 if (filter) { 1160 1160 sk_filter_uncharge(sk, filter); 1161 - rcu_assign_pointer(sk->sk_filter, NULL); 1161 + RCU_INIT_POINTER(sk->sk_filter, NULL); 1162 1162 } 1163 1163 1164 1164 sock_disable_timestamp(sk, SOCK_TIMESTAMP);
+3 -3
net/decnet/dn_dev.c
··· 388 388 } 389 389 390 390 ifa->ifa_next = dn_db->ifa_list; 391 - rcu_assign_pointer(dn_db->ifa_list, ifa); 391 + RCU_INIT_POINTER(dn_db->ifa_list, ifa); 392 392 393 393 dn_ifaddr_notify(RTM_NEWADDR, ifa); 394 394 blocking_notifier_call_chain(&dnaddr_chain, NETDEV_UP, ifa); ··· 1093 1093 1094 1094 memcpy(&dn_db->parms, p, sizeof(struct dn_dev_parms)); 1095 1095 1096 - rcu_assign_pointer(dev->dn_ptr, dn_db); 1096 + RCU_INIT_POINTER(dev->dn_ptr, dn_db); 1097 1097 dn_db->dev = dev; 1098 1098 init_timer(&dn_db->timer); 1099 1099 ··· 1101 1101 1102 1102 dn_db->neigh_parms = neigh_parms_alloc(dev, &dn_neigh_table); 1103 1103 if (!dn_db->neigh_parms) { 1104 - rcu_assign_pointer(dev->dn_ptr, NULL); 1104 + RCU_INIT_POINTER(dev->dn_ptr, NULL); 1105 1105 kfree(dn_db); 1106 1106 return NULL; 1107 1107 }
+3 -3
net/ipv4/devinet.c
··· 258 258 ip_mc_up(in_dev); 259 259 260 260 /* we can receive as soon as ip_ptr is set -- do this last */ 261 - rcu_assign_pointer(dev->ip_ptr, in_dev); 261 + RCU_INIT_POINTER(dev->ip_ptr, in_dev); 262 262 out: 263 263 return in_dev; 264 264 out_kfree: ··· 291 291 inet_free_ifa(ifa); 292 292 } 293 293 294 - rcu_assign_pointer(dev->ip_ptr, NULL); 294 + RCU_INIT_POINTER(dev->ip_ptr, NULL); 295 295 296 296 devinet_sysctl_unregister(in_dev); 297 297 neigh_parms_release(&arp_tbl, in_dev->arp_parms); ··· 1175 1175 switch (event) { 1176 1176 case NETDEV_REGISTER: 1177 1177 printk(KERN_DEBUG "inetdev_event: bug\n"); 1178 - rcu_assign_pointer(dev->ip_ptr, NULL); 1178 + RCU_INIT_POINTER(dev->ip_ptr, NULL); 1179 1179 break; 1180 1180 case NETDEV_UP: 1181 1181 if (!inetdev_valid_mtu(dev->mtu))
+6 -6
net/ipv4/fib_trie.c
··· 204 204 return (struct tnode *)(parent & ~NODE_TYPE_MASK); 205 205 } 206 206 207 - /* Same as rcu_assign_pointer 207 + /* Same as RCU_INIT_POINTER 208 208 * but that macro() assumes that value is a pointer. 209 209 */ 210 210 static inline void node_set_parent(struct rt_trie_node *node, struct tnode *ptr) ··· 528 528 if (n) 529 529 node_set_parent(n, tn); 530 530 531 - rcu_assign_pointer(tn->child[i], n); 531 + RCU_INIT_POINTER(tn->child[i], n); 532 532 } 533 533 534 534 #define MAX_WORK 10 ··· 1014 1014 1015 1015 tp = node_parent((struct rt_trie_node *) tn); 1016 1016 if (!tp) 1017 - rcu_assign_pointer(t->trie, (struct rt_trie_node *)tn); 1017 + RCU_INIT_POINTER(t->trie, (struct rt_trie_node *)tn); 1018 1018 1019 1019 tnode_free_flush(); 1020 1020 if (!tp) ··· 1026 1026 if (IS_TNODE(tn)) 1027 1027 tn = (struct tnode *)resize(t, (struct tnode *)tn); 1028 1028 1029 - rcu_assign_pointer(t->trie, (struct rt_trie_node *)tn); 1029 + RCU_INIT_POINTER(t->trie, (struct rt_trie_node *)tn); 1030 1030 tnode_free_flush(); 1031 1031 } 1032 1032 ··· 1163 1163 put_child(t, (struct tnode *)tp, cindex, 1164 1164 (struct rt_trie_node *)tn); 1165 1165 } else { 1166 - rcu_assign_pointer(t->trie, (struct rt_trie_node *)tn); 1166 + RCU_INIT_POINTER(t->trie, (struct rt_trie_node *)tn); 1167 1167 tp = tn; 1168 1168 } 1169 1169 } ··· 1621 1621 put_child(t, (struct tnode *)tp, cindex, NULL); 1622 1622 trie_rebalance(t, tp); 1623 1623 } else 1624 - rcu_assign_pointer(t->trie, NULL); 1624 + RCU_INIT_POINTER(t->trie, NULL); 1625 1625 1626 1626 free_leaf(l); 1627 1627 }
+2 -2
net/ipv4/gre.c
··· 34 34 if (gre_proto[version]) 35 35 goto err_out_unlock; 36 36 37 - rcu_assign_pointer(gre_proto[version], proto); 37 + RCU_INIT_POINTER(gre_proto[version], proto); 38 38 spin_unlock(&gre_proto_lock); 39 39 return 0; 40 40 ··· 54 54 if (rcu_dereference_protected(gre_proto[version], 55 55 lockdep_is_held(&gre_proto_lock)) != proto) 56 56 goto err_out_unlock; 57 - rcu_assign_pointer(gre_proto[version], NULL); 57 + RCU_INIT_POINTER(gre_proto[version], NULL); 58 58 spin_unlock(&gre_proto_lock); 59 59 synchronize_rcu(); 60 60 return 0;
+5 -5
net/ipv4/igmp.c
··· 1242 1242 1243 1243 im->next_rcu = in_dev->mc_list; 1244 1244 in_dev->mc_count++; 1245 - rcu_assign_pointer(in_dev->mc_list, im); 1245 + RCU_INIT_POINTER(in_dev->mc_list, im); 1246 1246 1247 1247 #ifdef CONFIG_IP_MULTICAST 1248 1248 igmpv3_del_delrec(in_dev, im->multiaddr); ··· 1813 1813 iml->next_rcu = inet->mc_list; 1814 1814 iml->sflist = NULL; 1815 1815 iml->sfmode = MCAST_EXCLUDE; 1816 - rcu_assign_pointer(inet->mc_list, iml); 1816 + RCU_INIT_POINTER(inet->mc_list, iml); 1817 1817 ip_mc_inc_group(in_dev, addr); 1818 1818 err = 0; 1819 1819 done: ··· 1835 1835 } 1836 1836 err = ip_mc_del_src(in_dev, &iml->multi.imr_multiaddr.s_addr, 1837 1837 iml->sfmode, psf->sl_count, psf->sl_addr, 0); 1838 - rcu_assign_pointer(iml->sflist, NULL); 1838 + RCU_INIT_POINTER(iml->sflist, NULL); 1839 1839 /* decrease mem now to avoid the memleak warning */ 1840 1840 atomic_sub(IP_SFLSIZE(psf->sl_max), &sk->sk_omem_alloc); 1841 1841 kfree_rcu(psf, rcu); ··· 2000 2000 atomic_sub(IP_SFLSIZE(psl->sl_max), &sk->sk_omem_alloc); 2001 2001 kfree_rcu(psl, rcu); 2002 2002 } 2003 - rcu_assign_pointer(pmc->sflist, newpsl); 2003 + RCU_INIT_POINTER(pmc->sflist, newpsl); 2004 2004 psl = newpsl; 2005 2005 } 2006 2006 rv = 1; /* > 0 for insert logic below if sl_count is 0 */ ··· 2103 2103 } else 2104 2104 (void) ip_mc_del_src(in_dev, &msf->imsf_multiaddr, pmc->sfmode, 2105 2105 0, NULL, 0); 2106 - rcu_assign_pointer(pmc->sflist, newpsl); 2106 + RCU_INIT_POINTER(pmc->sflist, newpsl); 2107 2107 pmc->sfmode = msf->imsf_fmode; 2108 2108 err = 0; 2109 2109 done:
+5 -5
net/ipv4/ipip.c
··· 231 231 (iter = rtnl_dereference(*tp)) != NULL; 232 232 tp = &iter->next) { 233 233 if (t == iter) { 234 - rcu_assign_pointer(*tp, t->next); 234 + RCU_INIT_POINTER(*tp, t->next); 235 235 break; 236 236 } 237 237 } ··· 241 241 { 242 242 struct ip_tunnel __rcu **tp = ipip_bucket(ipn, t); 243 243 244 - rcu_assign_pointer(t->next, rtnl_dereference(*tp)); 245 - rcu_assign_pointer(*tp, t); 244 + RCU_INIT_POINTER(t->next, rtnl_dereference(*tp)); 245 + RCU_INIT_POINTER(*tp, t); 246 246 } 247 247 248 248 static struct ip_tunnel * ipip_tunnel_locate(struct net *net, ··· 301 301 struct ipip_net *ipn = net_generic(net, ipip_net_id); 302 302 303 303 if (dev == ipn->fb_tunnel_dev) 304 - rcu_assign_pointer(ipn->tunnels_wc[0], NULL); 304 + RCU_INIT_POINTER(ipn->tunnels_wc[0], NULL); 305 305 else 306 306 ipip_tunnel_unlink(ipn, netdev_priv(dev)); 307 307 dev_put(dev); ··· 791 791 return -ENOMEM; 792 792 793 793 dev_hold(dev); 794 - rcu_assign_pointer(ipn->tunnels_wc[0], tunnel); 794 + RCU_INIT_POINTER(ipn->tunnels_wc[0], tunnel); 795 795 return 0; 796 796 } 797 797
+2 -2
net/ipv4/ipmr.c
··· 1176 1176 ipmr_for_each_table(mrt, net) { 1177 1177 if (sk == rtnl_dereference(mrt->mroute_sk)) { 1178 1178 IPV4_DEVCONF_ALL(net, MC_FORWARDING)--; 1179 - rcu_assign_pointer(mrt->mroute_sk, NULL); 1179 + RCU_INIT_POINTER(mrt->mroute_sk, NULL); 1180 1180 mroute_clean_tables(mrt); 1181 1181 } 1182 1182 } ··· 1224 1224 1225 1225 ret = ip_ra_control(sk, 1, mrtsock_destruct); 1226 1226 if (ret == 0) { 1227 - rcu_assign_pointer(mrt->mroute_sk, sk); 1227 + RCU_INIT_POINTER(mrt->mroute_sk, sk); 1228 1228 IPV4_DEVCONF_ALL(net, MC_FORWARDING)++; 1229 1229 } 1230 1230 rtnl_unlock();
+2 -2
net/ipv4/netfilter/nf_nat_amanda.c
··· 70 70 71 71 static void __exit nf_nat_amanda_fini(void) 72 72 { 73 - rcu_assign_pointer(nf_nat_amanda_hook, NULL); 73 + RCU_INIT_POINTER(nf_nat_amanda_hook, NULL); 74 74 synchronize_rcu(); 75 75 } 76 76 77 77 static int __init nf_nat_amanda_init(void) 78 78 { 79 79 BUG_ON(nf_nat_amanda_hook != NULL); 80 - rcu_assign_pointer(nf_nat_amanda_hook, help); 80 + RCU_INIT_POINTER(nf_nat_amanda_hook, help); 81 81 return 0; 82 82 } 83 83
+12 -12
net/ipv4/netfilter/nf_nat_core.c
··· 514 514 ret = -EBUSY; 515 515 goto out; 516 516 } 517 - rcu_assign_pointer(nf_nat_protos[proto->protonum], proto); 517 + RCU_INIT_POINTER(nf_nat_protos[proto->protonum], proto); 518 518 out: 519 519 spin_unlock_bh(&nf_nat_lock); 520 520 return ret; ··· 525 525 void nf_nat_protocol_unregister(const struct nf_nat_protocol *proto) 526 526 { 527 527 spin_lock_bh(&nf_nat_lock); 528 - rcu_assign_pointer(nf_nat_protos[proto->protonum], 528 + RCU_INIT_POINTER(nf_nat_protos[proto->protonum], 529 529 &nf_nat_unknown_protocol); 530 530 spin_unlock_bh(&nf_nat_lock); 531 531 synchronize_rcu(); ··· 736 736 /* Sew in builtin protocols. */ 737 737 spin_lock_bh(&nf_nat_lock); 738 738 for (i = 0; i < MAX_IP_NAT_PROTO; i++) 739 - rcu_assign_pointer(nf_nat_protos[i], &nf_nat_unknown_protocol); 740 - rcu_assign_pointer(nf_nat_protos[IPPROTO_TCP], &nf_nat_protocol_tcp); 741 - rcu_assign_pointer(nf_nat_protos[IPPROTO_UDP], &nf_nat_protocol_udp); 742 - rcu_assign_pointer(nf_nat_protos[IPPROTO_ICMP], &nf_nat_protocol_icmp); 739 + RCU_INIT_POINTER(nf_nat_protos[i], &nf_nat_unknown_protocol); 740 + RCU_INIT_POINTER(nf_nat_protos[IPPROTO_TCP], &nf_nat_protocol_tcp); 741 + RCU_INIT_POINTER(nf_nat_protos[IPPROTO_UDP], &nf_nat_protocol_udp); 742 + RCU_INIT_POINTER(nf_nat_protos[IPPROTO_ICMP], &nf_nat_protocol_icmp); 743 743 spin_unlock_bh(&nf_nat_lock); 744 744 745 745 /* Initialize fake conntrack so that NAT will skip it */ ··· 748 748 l3proto = nf_ct_l3proto_find_get((u_int16_t)AF_INET); 749 749 750 750 BUG_ON(nf_nat_seq_adjust_hook != NULL); 751 - rcu_assign_pointer(nf_nat_seq_adjust_hook, nf_nat_seq_adjust); 751 + RCU_INIT_POINTER(nf_nat_seq_adjust_hook, nf_nat_seq_adjust); 752 752 BUG_ON(nfnetlink_parse_nat_setup_hook != NULL); 753 - rcu_assign_pointer(nfnetlink_parse_nat_setup_hook, 753 + RCU_INIT_POINTER(nfnetlink_parse_nat_setup_hook, 754 754 nfnetlink_parse_nat_setup); 755 755 BUG_ON(nf_ct_nat_offset != NULL); 756 - rcu_assign_pointer(nf_ct_nat_offset, nf_nat_get_offset); 756 + RCU_INIT_POINTER(nf_ct_nat_offset, nf_nat_get_offset); 757 757 return 0; 758 758 759 759 cleanup_extend: ··· 766 766 unregister_pernet_subsys(&nf_nat_net_ops); 767 767 nf_ct_l3proto_put(l3proto); 768 768 nf_ct_extend_unregister(&nat_extend); 769 - rcu_assign_pointer(nf_nat_seq_adjust_hook, NULL); 770 - rcu_assign_pointer(nfnetlink_parse_nat_setup_hook, NULL); 771 - rcu_assign_pointer(nf_ct_nat_offset, NULL); 769 + RCU_INIT_POINTER(nf_nat_seq_adjust_hook, NULL); 770 + RCU_INIT_POINTER(nfnetlink_parse_nat_setup_hook, NULL); 771 + RCU_INIT_POINTER(nf_ct_nat_offset, NULL); 772 772 synchronize_net(); 773 773 } 774 774
+2 -2
net/ipv4/netfilter/nf_nat_ftp.c
··· 113 113 114 114 static void __exit nf_nat_ftp_fini(void) 115 115 { 116 - rcu_assign_pointer(nf_nat_ftp_hook, NULL); 116 + RCU_INIT_POINTER(nf_nat_ftp_hook, NULL); 117 117 synchronize_rcu(); 118 118 } 119 119 120 120 static int __init nf_nat_ftp_init(void) 121 121 { 122 122 BUG_ON(nf_nat_ftp_hook != NULL); 123 - rcu_assign_pointer(nf_nat_ftp_hook, nf_nat_ftp); 123 + RCU_INIT_POINTER(nf_nat_ftp_hook, nf_nat_ftp); 124 124 return 0; 125 125 } 126 126
+18 -18
net/ipv4/netfilter/nf_nat_h323.c
··· 581 581 BUG_ON(nat_callforwarding_hook != NULL); 582 582 BUG_ON(nat_q931_hook != NULL); 583 583 584 - rcu_assign_pointer(set_h245_addr_hook, set_h245_addr); 585 - rcu_assign_pointer(set_h225_addr_hook, set_h225_addr); 586 - rcu_assign_pointer(set_sig_addr_hook, set_sig_addr); 587 - rcu_assign_pointer(set_ras_addr_hook, set_ras_addr); 588 - rcu_assign_pointer(nat_rtp_rtcp_hook, nat_rtp_rtcp); 589 - rcu_assign_pointer(nat_t120_hook, nat_t120); 590 - rcu_assign_pointer(nat_h245_hook, nat_h245); 591 - rcu_assign_pointer(nat_callforwarding_hook, nat_callforwarding); 592 - rcu_assign_pointer(nat_q931_hook, nat_q931); 584 + RCU_INIT_POINTER(set_h245_addr_hook, set_h245_addr); 585 + RCU_INIT_POINTER(set_h225_addr_hook, set_h225_addr); 586 + RCU_INIT_POINTER(set_sig_addr_hook, set_sig_addr); 587 + RCU_INIT_POINTER(set_ras_addr_hook, set_ras_addr); 588 + RCU_INIT_POINTER(nat_rtp_rtcp_hook, nat_rtp_rtcp); 589 + RCU_INIT_POINTER(nat_t120_hook, nat_t120); 590 + RCU_INIT_POINTER(nat_h245_hook, nat_h245); 591 + RCU_INIT_POINTER(nat_callforwarding_hook, nat_callforwarding); 592 + RCU_INIT_POINTER(nat_q931_hook, nat_q931); 593 593 return 0; 594 594 } 595 595 596 596 /****************************************************************************/ 597 597 static void __exit fini(void) 598 598 { 599 - rcu_assign_pointer(set_h245_addr_hook, NULL); 600 - rcu_assign_pointer(set_h225_addr_hook, NULL); 601 - rcu_assign_pointer(set_sig_addr_hook, NULL); 602 - rcu_assign_pointer(set_ras_addr_hook, NULL); 603 - rcu_assign_pointer(nat_rtp_rtcp_hook, NULL); 604 - rcu_assign_pointer(nat_t120_hook, NULL); 605 - rcu_assign_pointer(nat_h245_hook, NULL); 606 - rcu_assign_pointer(nat_callforwarding_hook, NULL); 607 - rcu_assign_pointer(nat_q931_hook, NULL); 599 + RCU_INIT_POINTER(set_h245_addr_hook, NULL); 600 + RCU_INIT_POINTER(set_h225_addr_hook, NULL); 601 + RCU_INIT_POINTER(set_sig_addr_hook, NULL); 602 + RCU_INIT_POINTER(set_ras_addr_hook, NULL); 603 + RCU_INIT_POINTER(nat_rtp_rtcp_hook, NULL); 604 + RCU_INIT_POINTER(nat_t120_hook, NULL); 605 + RCU_INIT_POINTER(nat_h245_hook, NULL); 606 + RCU_INIT_POINTER(nat_callforwarding_hook, NULL); 607 + RCU_INIT_POINTER(nat_q931_hook, NULL); 608 608 synchronize_rcu(); 609 609 } 610 610
+2 -2
net/ipv4/netfilter/nf_nat_irc.c
··· 75 75 76 76 static void __exit nf_nat_irc_fini(void) 77 77 { 78 - rcu_assign_pointer(nf_nat_irc_hook, NULL); 78 + RCU_INIT_POINTER(nf_nat_irc_hook, NULL); 79 79 synchronize_rcu(); 80 80 } 81 81 82 82 static int __init nf_nat_irc_init(void) 83 83 { 84 84 BUG_ON(nf_nat_irc_hook != NULL); 85 - rcu_assign_pointer(nf_nat_irc_hook, help); 85 + RCU_INIT_POINTER(nf_nat_irc_hook, help); 86 86 return 0; 87 87 } 88 88
+8 -8
net/ipv4/netfilter/nf_nat_pptp.c
··· 282 282 nf_nat_need_gre(); 283 283 284 284 BUG_ON(nf_nat_pptp_hook_outbound != NULL); 285 - rcu_assign_pointer(nf_nat_pptp_hook_outbound, pptp_outbound_pkt); 285 + RCU_INIT_POINTER(nf_nat_pptp_hook_outbound, pptp_outbound_pkt); 286 286 287 287 BUG_ON(nf_nat_pptp_hook_inbound != NULL); 288 - rcu_assign_pointer(nf_nat_pptp_hook_inbound, pptp_inbound_pkt); 288 + RCU_INIT_POINTER(nf_nat_pptp_hook_inbound, pptp_inbound_pkt); 289 289 290 290 BUG_ON(nf_nat_pptp_hook_exp_gre != NULL); 291 - rcu_assign_pointer(nf_nat_pptp_hook_exp_gre, pptp_exp_gre); 291 + RCU_INIT_POINTER(nf_nat_pptp_hook_exp_gre, pptp_exp_gre); 292 292 293 293 BUG_ON(nf_nat_pptp_hook_expectfn != NULL); 294 - rcu_assign_pointer(nf_nat_pptp_hook_expectfn, pptp_nat_expected); 294 + RCU_INIT_POINTER(nf_nat_pptp_hook_expectfn, pptp_nat_expected); 295 295 return 0; 296 296 } 297 297 298 298 static void __exit nf_nat_helper_pptp_fini(void) 299 299 { 300 - rcu_assign_pointer(nf_nat_pptp_hook_expectfn, NULL); 301 - rcu_assign_pointer(nf_nat_pptp_hook_exp_gre, NULL); 302 - rcu_assign_pointer(nf_nat_pptp_hook_inbound, NULL); 303 - rcu_assign_pointer(nf_nat_pptp_hook_outbound, NULL); 300 + RCU_INIT_POINTER(nf_nat_pptp_hook_expectfn, NULL); 301 + RCU_INIT_POINTER(nf_nat_pptp_hook_exp_gre, NULL); 302 + RCU_INIT_POINTER(nf_nat_pptp_hook_inbound, NULL); 303 + RCU_INIT_POINTER(nf_nat_pptp_hook_outbound, NULL); 304 304 synchronize_rcu(); 305 305 } 306 306
+14 -14
net/ipv4/netfilter/nf_nat_sip.c
··· 528 528 529 529 static void __exit nf_nat_sip_fini(void) 530 530 { 531 - rcu_assign_pointer(nf_nat_sip_hook, NULL); 532 - rcu_assign_pointer(nf_nat_sip_seq_adjust_hook, NULL); 533 - rcu_assign_pointer(nf_nat_sip_expect_hook, NULL); 534 - rcu_assign_pointer(nf_nat_sdp_addr_hook, NULL); 535 - rcu_assign_pointer(nf_nat_sdp_port_hook, NULL); 536 - rcu_assign_pointer(nf_nat_sdp_session_hook, NULL); 537 - rcu_assign_pointer(nf_nat_sdp_media_hook, NULL); 531 + RCU_INIT_POINTER(nf_nat_sip_hook, NULL); 532 + RCU_INIT_POINTER(nf_nat_sip_seq_adjust_hook, NULL); 533 + RCU_INIT_POINTER(nf_nat_sip_expect_hook, NULL); 534 + RCU_INIT_POINTER(nf_nat_sdp_addr_hook, NULL); 535 + RCU_INIT_POINTER(nf_nat_sdp_port_hook, NULL); 536 + RCU_INIT_POINTER(nf_nat_sdp_session_hook, NULL); 537 + RCU_INIT_POINTER(nf_nat_sdp_media_hook, NULL); 538 538 synchronize_rcu(); 539 539 } 540 540 ··· 547 547 BUG_ON(nf_nat_sdp_port_hook != NULL); 548 548 BUG_ON(nf_nat_sdp_session_hook != NULL); 549 549 BUG_ON(nf_nat_sdp_media_hook != NULL); 550 - rcu_assign_pointer(nf_nat_sip_hook, ip_nat_sip); 551 - rcu_assign_pointer(nf_nat_sip_seq_adjust_hook, ip_nat_sip_seq_adjust); 552 - rcu_assign_pointer(nf_nat_sip_expect_hook, ip_nat_sip_expect); 553 - rcu_assign_pointer(nf_nat_sdp_addr_hook, ip_nat_sdp_addr); 554 - rcu_assign_pointer(nf_nat_sdp_port_hook, ip_nat_sdp_port); 555 - rcu_assign_pointer(nf_nat_sdp_session_hook, ip_nat_sdp_session); 556 - rcu_assign_pointer(nf_nat_sdp_media_hook, ip_nat_sdp_media); 550 + RCU_INIT_POINTER(nf_nat_sip_hook, ip_nat_sip); 551 + RCU_INIT_POINTER(nf_nat_sip_seq_adjust_hook, ip_nat_sip_seq_adjust); 552 + RCU_INIT_POINTER(nf_nat_sip_expect_hook, ip_nat_sip_expect); 553 + RCU_INIT_POINTER(nf_nat_sdp_addr_hook, ip_nat_sdp_addr); 554 + RCU_INIT_POINTER(nf_nat_sdp_port_hook, ip_nat_sdp_port); 555 + RCU_INIT_POINTER(nf_nat_sdp_session_hook, ip_nat_sdp_session); 556 + RCU_INIT_POINTER(nf_nat_sdp_media_hook, ip_nat_sdp_media); 557 557 return 0; 558 558 } 559 559
+2 -2
net/ipv4/netfilter/nf_nat_snmp_basic.c
··· 1310 1310 int ret = 0; 1311 1311 1312 1312 BUG_ON(nf_nat_snmp_hook != NULL); 1313 - rcu_assign_pointer(nf_nat_snmp_hook, help); 1313 + RCU_INIT_POINTER(nf_nat_snmp_hook, help); 1314 1314 1315 1315 ret = nf_conntrack_helper_register(&snmp_trap_helper); 1316 1316 if (ret < 0) { ··· 1322 1322 1323 1323 static void __exit nf_nat_snmp_basic_fini(void) 1324 1324 { 1325 - rcu_assign_pointer(nf_nat_snmp_hook, NULL); 1325 + RCU_INIT_POINTER(nf_nat_snmp_hook, NULL); 1326 1326 nf_conntrack_helper_unregister(&snmp_trap_helper); 1327 1327 } 1328 1328
+3 -3
net/ipv4/netfilter/nf_nat_standalone.c
··· 284 284 285 285 #ifdef CONFIG_XFRM 286 286 BUG_ON(ip_nat_decode_session != NULL); 287 - rcu_assign_pointer(ip_nat_decode_session, nat_decode_session); 287 + RCU_INIT_POINTER(ip_nat_decode_session, nat_decode_session); 288 288 #endif 289 289 ret = nf_nat_rule_init(); 290 290 if (ret < 0) { ··· 302 302 nf_nat_rule_cleanup(); 303 303 cleanup_decode_session: 304 304 #ifdef CONFIG_XFRM 305 - rcu_assign_pointer(ip_nat_decode_session, NULL); 305 + RCU_INIT_POINTER(ip_nat_decode_session, NULL); 306 306 synchronize_net(); 307 307 #endif 308 308 return ret; ··· 313 313 nf_unregister_hooks(nf_nat_ops, ARRAY_SIZE(nf_nat_ops)); 314 314 nf_nat_rule_cleanup(); 315 315 #ifdef CONFIG_XFRM 316 - rcu_assign_pointer(ip_nat_decode_session, NULL); 316 + RCU_INIT_POINTER(ip_nat_decode_session, NULL); 317 317 synchronize_net(); 318 318 #endif 319 319 /* Conntrack caches are unregistered in nf_conntrack_cleanup */
+2 -2
net/ipv4/netfilter/nf_nat_tftp.c
··· 36 36 37 37 static void __exit nf_nat_tftp_fini(void) 38 38 { 39 - rcu_assign_pointer(nf_nat_tftp_hook, NULL); 39 + RCU_INIT_POINTER(nf_nat_tftp_hook, NULL); 40 40 synchronize_rcu(); 41 41 } 42 42 43 43 static int __init nf_nat_tftp_init(void) 44 44 { 45 45 BUG_ON(nf_nat_tftp_hook != NULL); 46 - rcu_assign_pointer(nf_nat_tftp_hook, help); 46 + RCU_INIT_POINTER(nf_nat_tftp_hook, help); 47 47 return 0; 48 48 } 49 49
+2 -2
net/ipv6/addrconf.c
··· 428 428 ndev->tstamp = jiffies; 429 429 addrconf_sysctl_register(ndev); 430 430 /* protected by rtnl_lock */ 431 - rcu_assign_pointer(dev->ip6_ptr, ndev); 431 + RCU_INIT_POINTER(dev->ip6_ptr, ndev); 432 432 433 433 /* Join all-node multicast group */ 434 434 ipv6_dev_mc_inc(dev, &in6addr_linklocal_allnodes); ··· 2733 2733 idev->dead = 1; 2734 2734 2735 2735 /* protected by rtnl_lock */ 2736 - rcu_assign_pointer(dev->ip6_ptr, NULL); 2736 + RCU_INIT_POINTER(dev->ip6_ptr, NULL); 2737 2737 2738 2738 /* Step 1.5: remove snmp6 entry */ 2739 2739 snmp6_unregister_dev(idev);
+5 -5
net/ipv6/ip6_tunnel.c
··· 218 218 { 219 219 struct ip6_tnl __rcu **tp = ip6_tnl_bucket(ip6n, &t->parms); 220 220 221 - rcu_assign_pointer(t->next , rtnl_dereference(*tp)); 222 - rcu_assign_pointer(*tp, t); 221 + RCU_INIT_POINTER(t->next , rtnl_dereference(*tp)); 222 + RCU_INIT_POINTER(*tp, t); 223 223 } 224 224 225 225 /** ··· 237 237 (iter = rtnl_dereference(*tp)) != NULL; 238 238 tp = &iter->next) { 239 239 if (t == iter) { 240 - rcu_assign_pointer(*tp, t->next); 240 + RCU_INIT_POINTER(*tp, t->next); 241 241 break; 242 242 } 243 243 } ··· 350 350 struct ip6_tnl_net *ip6n = net_generic(net, ip6_tnl_net_id); 351 351 352 352 if (dev == ip6n->fb_tnl_dev) 353 - rcu_assign_pointer(ip6n->tnls_wc[0], NULL); 353 + RCU_INIT_POINTER(ip6n->tnls_wc[0], NULL); 354 354 else 355 355 ip6_tnl_unlink(ip6n, t); 356 356 ip6_tnl_dst_reset(t); ··· 1440 1440 1441 1441 t->parms.proto = IPPROTO_IPV6; 1442 1442 dev_hold(dev); 1443 - rcu_assign_pointer(ip6n->tnls_wc[0], t); 1443 + RCU_INIT_POINTER(ip6n->tnls_wc[0], t); 1444 1444 return 0; 1445 1445 } 1446 1446
+2 -2
net/ipv6/raw.c
··· 130 130 131 131 int rawv6_mh_filter_register(mh_filter_t filter) 132 132 { 133 - rcu_assign_pointer(mh_filter, filter); 133 + RCU_INIT_POINTER(mh_filter, filter); 134 134 return 0; 135 135 } 136 136 EXPORT_SYMBOL(rawv6_mh_filter_register); 137 137 138 138 int rawv6_mh_filter_unregister(mh_filter_t filter) 139 139 { 140 - rcu_assign_pointer(mh_filter, NULL); 140 + RCU_INIT_POINTER(mh_filter, NULL); 141 141 synchronize_rcu(); 142 142 return 0; 143 143 }
+6 -6
net/ipv6/sit.c
··· 182 182 (iter = rtnl_dereference(*tp)) != NULL; 183 183 tp = &iter->next) { 184 184 if (t == iter) { 185 - rcu_assign_pointer(*tp, t->next); 185 + RCU_INIT_POINTER(*tp, t->next); 186 186 break; 187 187 } 188 188 } ··· 192 192 { 193 193 struct ip_tunnel __rcu **tp = ipip6_bucket(sitn, t); 194 194 195 - rcu_assign_pointer(t->next, rtnl_dereference(*tp)); 196 - rcu_assign_pointer(*tp, t); 195 + RCU_INIT_POINTER(t->next, rtnl_dereference(*tp)); 196 + RCU_INIT_POINTER(*tp, t); 197 197 } 198 198 199 199 static void ipip6_tunnel_clone_6rd(struct net_device *dev, struct sit_net *sitn) ··· 391 391 p->addr = a->addr; 392 392 p->flags = a->flags; 393 393 t->prl_count++; 394 - rcu_assign_pointer(t->prl, p); 394 + RCU_INIT_POINTER(t->prl, p); 395 395 out: 396 396 return err; 397 397 } ··· 474 474 struct sit_net *sitn = net_generic(net, sit_net_id); 475 475 476 476 if (dev == sitn->fb_tunnel_dev) { 477 - rcu_assign_pointer(sitn->tunnels_wc[0], NULL); 477 + RCU_INIT_POINTER(sitn->tunnels_wc[0], NULL); 478 478 } else { 479 479 ipip6_tunnel_unlink(sitn, netdev_priv(dev)); 480 480 ipip6_tunnel_del_prl(netdev_priv(dev), NULL); ··· 1173 1173 if (!dev->tstats) 1174 1174 return -ENOMEM; 1175 1175 dev_hold(dev); 1176 - rcu_assign_pointer(sitn->tunnels_wc[0], tunnel); 1176 + RCU_INIT_POINTER(sitn->tunnels_wc[0], tunnel); 1177 1177 return 0; 1178 1178 } 1179 1179
+2 -2
net/mac80211/agg-rx.c
··· 69 69 if (!tid_rx) 70 70 return; 71 71 72 - rcu_assign_pointer(sta->ampdu_mlme.tid_rx[tid], NULL); 72 + RCU_INIT_POINTER(sta->ampdu_mlme.tid_rx[tid], NULL); 73 73 74 74 #ifdef CONFIG_MAC80211_HT_DEBUG 75 75 printk(KERN_DEBUG "Rx BA session stop requested for %pM tid %u\n", ··· 340 340 status = WLAN_STATUS_SUCCESS; 341 341 342 342 /* activate it for RX */ 343 - rcu_assign_pointer(sta->ampdu_mlme.tid_rx[tid], tid_agg_rx); 343 + RCU_INIT_POINTER(sta->ampdu_mlme.tid_rx[tid], tid_agg_rx); 344 344 345 345 if (timeout) 346 346 mod_timer(&tid_agg_rx->session_timer, TU_TO_EXP_TIME(timeout));
+4 -4
net/mac80211/cfg.c
··· 62 62 63 63 if (type == NL80211_IFTYPE_AP_VLAN && 64 64 params && params->use_4addr == 0) 65 - rcu_assign_pointer(sdata->u.vlan.sta, NULL); 65 + RCU_INIT_POINTER(sdata->u.vlan.sta, NULL); 66 66 else if (type == NL80211_IFTYPE_STATION && 67 67 params && params->use_4addr >= 0) 68 68 sdata->u.mgd.use_4addr = params->use_4addr; ··· 542 542 543 543 sdata->vif.bss_conf.dtim_period = new->dtim_period; 544 544 545 - rcu_assign_pointer(sdata->u.ap.beacon, new); 545 + RCU_INIT_POINTER(sdata->u.ap.beacon, new); 546 546 547 547 synchronize_rcu(); 548 548 ··· 594 594 if (!old) 595 595 return -ENOENT; 596 596 597 - rcu_assign_pointer(sdata->u.ap.beacon, NULL); 597 + RCU_INIT_POINTER(sdata->u.ap.beacon, NULL); 598 598 synchronize_rcu(); 599 599 kfree(old); 600 600 ··· 857 857 return -EBUSY; 858 858 } 859 859 860 - rcu_assign_pointer(vlansdata->u.vlan.sta, sta); 860 + RCU_INIT_POINTER(vlansdata->u.vlan.sta, sta); 861 861 } 862 862 863 863 sta->sdata = vlansdata;
+3 -3
net/mac80211/ibss.c
··· 84 84 drv_reset_tsf(local); 85 85 86 86 skb = ifibss->skb; 87 - rcu_assign_pointer(ifibss->presp, NULL); 87 + RCU_INIT_POINTER(ifibss->presp, NULL); 88 88 synchronize_rcu(); 89 89 skb->data = skb->head; 90 90 skb->len = 0; ··· 184 184 *pos++ = 0; /* U-APSD no in use */ 185 185 } 186 186 187 - rcu_assign_pointer(ifibss->presp, skb); 187 + RCU_INIT_POINTER(ifibss->presp, skb); 188 188 189 189 sdata->vif.bss_conf.beacon_int = beacon_int; 190 190 sdata->vif.bss_conf.basic_rates = basic_rates; ··· 995 995 kfree(sdata->u.ibss.ie); 996 996 skb = rcu_dereference_protected(sdata->u.ibss.presp, 997 997 lockdep_is_held(&sdata->u.ibss.mtx)); 998 - rcu_assign_pointer(sdata->u.ibss.presp, NULL); 998 + RCU_INIT_POINTER(sdata->u.ibss.presp, NULL); 999 999 sdata->vif.bss_conf.ibss_joined = false; 1000 1000 ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BEACON_ENABLED | 1001 1001 BSS_CHANGED_IBSS);
+1 -1
net/mac80211/iface.c
··· 456 456 BSS_CHANGED_BEACON_ENABLED); 457 457 458 458 /* remove beacon */ 459 - rcu_assign_pointer(sdata->u.ap.beacon, NULL); 459 + RCU_INIT_POINTER(sdata->u.ap.beacon, NULL); 460 460 synchronize_rcu(); 461 461 kfree(old_beacon); 462 462
+4 -4
net/mac80211/sta_info.c
··· 72 72 if (!s) 73 73 return -ENOENT; 74 74 if (s == sta) { 75 - rcu_assign_pointer(local->sta_hash[STA_HASH(sta->sta.addr)], 75 + RCU_INIT_POINTER(local->sta_hash[STA_HASH(sta->sta.addr)], 76 76 s->hnext); 77 77 return 0; 78 78 } ··· 82 82 s = rcu_dereference_protected(s->hnext, 83 83 lockdep_is_held(&local->sta_lock)); 84 84 if (rcu_access_pointer(s->hnext)) { 85 - rcu_assign_pointer(s->hnext, sta->hnext); 85 + RCU_INIT_POINTER(s->hnext, sta->hnext); 86 86 return 0; 87 87 } 88 88 ··· 184 184 struct sta_info *sta) 185 185 { 186 186 sta->hnext = local->sta_hash[STA_HASH(sta->sta.addr)]; 187 - rcu_assign_pointer(local->sta_hash[STA_HASH(sta->sta.addr)], sta); 187 + RCU_INIT_POINTER(local->sta_hash[STA_HASH(sta->sta.addr)], sta); 188 188 } 189 189 190 190 static void sta_unblock(struct work_struct *wk) ··· 672 672 local->sta_generation++; 673 673 674 674 if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN) 675 - rcu_assign_pointer(sdata->u.vlan.sta, NULL); 675 + RCU_INIT_POINTER(sdata->u.vlan.sta, NULL); 676 676 677 677 if (sta->uploaded) { 678 678 if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
+2 -2
net/netfilter/core.c
··· 37 37 err = mutex_lock_interruptible(&afinfo_mutex); 38 38 if (err < 0) 39 39 return err; 40 - rcu_assign_pointer(nf_afinfo[afinfo->family], afinfo); 40 + RCU_INIT_POINTER(nf_afinfo[afinfo->family], afinfo); 41 41 mutex_unlock(&afinfo_mutex); 42 42 return 0; 43 43 } ··· 46 46 void nf_unregister_afinfo(const struct nf_afinfo *afinfo) 47 47 { 48 48 mutex_lock(&afinfo_mutex); 49 - rcu_assign_pointer(nf_afinfo[afinfo->family], NULL); 49 + RCU_INIT_POINTER(nf_afinfo[afinfo->family], NULL); 50 50 mutex_unlock(&afinfo_mutex); 51 51 synchronize_rcu(); 52 52 }
+6 -6
net/netfilter/nf_conntrack_core.c
··· 779 779 if (exp->helper) { 780 780 help = nf_ct_helper_ext_add(ct, GFP_ATOMIC); 781 781 if (help) 782 - rcu_assign_pointer(help->helper, exp->helper); 782 + RCU_INIT_POINTER(help->helper, exp->helper); 783 783 } 784 784 785 785 #ifdef CONFIG_NF_CONNTRACK_MARK ··· 1317 1317 void nf_conntrack_cleanup(struct net *net) 1318 1318 { 1319 1319 if (net_eq(net, &init_net)) 1320 - rcu_assign_pointer(ip_ct_attach, NULL); 1320 + RCU_INIT_POINTER(ip_ct_attach, NULL); 1321 1321 1322 1322 /* This makes sure all current packets have passed through 1323 1323 netfilter framework. Roll on, two-stage module ··· 1327 1327 nf_conntrack_cleanup_net(net); 1328 1328 1329 1329 if (net_eq(net, &init_net)) { 1330 - rcu_assign_pointer(nf_ct_destroy, NULL); 1330 + RCU_INIT_POINTER(nf_ct_destroy, NULL); 1331 1331 nf_conntrack_cleanup_init_net(); 1332 1332 } 1333 1333 } ··· 1576 1576 1577 1577 if (net_eq(net, &init_net)) { 1578 1578 /* For use by REJECT target */ 1579 - rcu_assign_pointer(ip_ct_attach, nf_conntrack_attach); 1580 - rcu_assign_pointer(nf_ct_destroy, destroy_conntrack); 1579 + RCU_INIT_POINTER(ip_ct_attach, nf_conntrack_attach); 1580 + RCU_INIT_POINTER(nf_ct_destroy, destroy_conntrack); 1581 1581 1582 1582 /* Howto get NAT offsets */ 1583 - rcu_assign_pointer(nf_ct_nat_offset, NULL); 1583 + RCU_INIT_POINTER(nf_ct_nat_offset, NULL); 1584 1584 } 1585 1585 return 0; 1586 1586
+4 -4
net/netfilter/nf_conntrack_ecache.c
··· 94 94 ret = -EBUSY; 95 95 goto out_unlock; 96 96 } 97 - rcu_assign_pointer(nf_conntrack_event_cb, new); 97 + RCU_INIT_POINTER(nf_conntrack_event_cb, new); 98 98 mutex_unlock(&nf_ct_ecache_mutex); 99 99 return ret; 100 100 ··· 112 112 notify = rcu_dereference_protected(nf_conntrack_event_cb, 113 113 lockdep_is_held(&nf_ct_ecache_mutex)); 114 114 BUG_ON(notify != new); 115 - rcu_assign_pointer(nf_conntrack_event_cb, NULL); 115 + RCU_INIT_POINTER(nf_conntrack_event_cb, NULL); 116 116 mutex_unlock(&nf_ct_ecache_mutex); 117 117 } 118 118 EXPORT_SYMBOL_GPL(nf_conntrack_unregister_notifier); ··· 129 129 ret = -EBUSY; 130 130 goto out_unlock; 131 131 } 132 - rcu_assign_pointer(nf_expect_event_cb, new); 132 + RCU_INIT_POINTER(nf_expect_event_cb, new); 133 133 mutex_unlock(&nf_ct_ecache_mutex); 134 134 return ret; 135 135 ··· 147 147 notify = rcu_dereference_protected(nf_expect_event_cb, 148 148 lockdep_is_held(&nf_ct_ecache_mutex)); 149 149 BUG_ON(notify != new); 150 - rcu_assign_pointer(nf_expect_event_cb, NULL); 150 + RCU_INIT_POINTER(nf_expect_event_cb, NULL); 151 151 mutex_unlock(&nf_ct_ecache_mutex); 152 152 } 153 153 EXPORT_SYMBOL_GPL(nf_ct_expect_unregister_notifier);
+2 -2
net/netfilter/nf_conntrack_extend.c
··· 169 169 before updating alloc_size */ 170 170 type->alloc_size = ALIGN(sizeof(struct nf_ct_ext), type->align) 171 171 + type->len; 172 - rcu_assign_pointer(nf_ct_ext_types[type->id], type); 172 + RCU_INIT_POINTER(nf_ct_ext_types[type->id], type); 173 173 update_alloc_size(type); 174 174 out: 175 175 mutex_unlock(&nf_ct_ext_type_mutex); ··· 181 181 void nf_ct_extend_unregister(struct nf_ct_ext_type *type) 182 182 { 183 183 mutex_lock(&nf_ct_ext_type_mutex); 184 - rcu_assign_pointer(nf_ct_ext_types[type->id], NULL); 184 + RCU_INIT_POINTER(nf_ct_ext_types[type->id], NULL); 185 185 update_alloc_size(type); 186 186 mutex_unlock(&nf_ct_ext_type_mutex); 187 187 rcu_barrier(); /* Wait for completion of call_rcu()'s */
+3 -3
net/netfilter/nf_conntrack_helper.c
··· 131 131 helper = __nf_ct_helper_find(&ct->tuplehash[IP_CT_DIR_REPLY].tuple); 132 132 if (helper == NULL) { 133 133 if (help) 134 - rcu_assign_pointer(help->helper, NULL); 134 + RCU_INIT_POINTER(help->helper, NULL); 135 135 goto out; 136 136 } 137 137 ··· 145 145 memset(&help->help, 0, sizeof(help->help)); 146 146 } 147 147 148 - rcu_assign_pointer(help->helper, helper); 148 + RCU_INIT_POINTER(help->helper, helper); 149 149 out: 150 150 return ret; 151 151 } ··· 162 162 lockdep_is_held(&nf_conntrack_lock) 163 163 ) == me) { 164 164 nf_conntrack_event(IPCT_HELPER, ct); 165 - rcu_assign_pointer(help->helper, NULL); 165 + RCU_INIT_POINTER(help->helper, NULL); 166 166 } 167 167 return 0; 168 168 }
+3 -3
net/netfilter/nf_conntrack_netlink.c
··· 1125 1125 if (help && help->helper) { 1126 1126 /* we had a helper before ... */ 1127 1127 nf_ct_remove_expectations(ct); 1128 - rcu_assign_pointer(help->helper, NULL); 1128 + RCU_INIT_POINTER(help->helper, NULL); 1129 1129 } 1130 1130 1131 1131 return 0; ··· 1163 1163 return -EOPNOTSUPP; 1164 1164 } 1165 1165 1166 - rcu_assign_pointer(help->helper, helper); 1166 + RCU_INIT_POINTER(help->helper, helper); 1167 1167 1168 1168 return 0; 1169 1169 } ··· 1386 1386 } 1387 1387 1388 1388 /* not in hash table yet so not strictly necessary */ 1389 - rcu_assign_pointer(help->helper, helper); 1389 + RCU_INIT_POINTER(help->helper, helper); 1390 1390 } 1391 1391 } else { 1392 1392 /* try an implicit helper assignation */
+5 -5
net/netfilter/nf_log.c
··· 55 55 llog = rcu_dereference_protected(nf_loggers[pf], 56 56 lockdep_is_held(&nf_log_mutex)); 57 57 if (llog == NULL) 58 - rcu_assign_pointer(nf_loggers[pf], logger); 58 + RCU_INIT_POINTER(nf_loggers[pf], logger); 59 59 } 60 60 61 61 mutex_unlock(&nf_log_mutex); ··· 74 74 c_logger = rcu_dereference_protected(nf_loggers[i], 75 75 lockdep_is_held(&nf_log_mutex)); 76 76 if (c_logger == logger) 77 - rcu_assign_pointer(nf_loggers[i], NULL); 77 + RCU_INIT_POINTER(nf_loggers[i], NULL); 78 78 list_del(&logger->list[i]); 79 79 } 80 80 mutex_unlock(&nf_log_mutex); ··· 92 92 mutex_unlock(&nf_log_mutex); 93 93 return -ENOENT; 94 94 } 95 - rcu_assign_pointer(nf_loggers[pf], logger); 95 + RCU_INIT_POINTER(nf_loggers[pf], logger); 96 96 mutex_unlock(&nf_log_mutex); 97 97 return 0; 98 98 } ··· 103 103 if (pf >= ARRAY_SIZE(nf_loggers)) 104 104 return; 105 105 mutex_lock(&nf_log_mutex); 106 - rcu_assign_pointer(nf_loggers[pf], NULL); 106 + RCU_INIT_POINTER(nf_loggers[pf], NULL); 107 107 mutex_unlock(&nf_log_mutex); 108 108 } 109 109 EXPORT_SYMBOL(nf_log_unbind_pf); ··· 250 250 mutex_unlock(&nf_log_mutex); 251 251 return -ENOENT; 252 252 } 253 - rcu_assign_pointer(nf_loggers[tindex], logger); 253 + RCU_INIT_POINTER(nf_loggers[tindex], logger); 254 254 mutex_unlock(&nf_log_mutex); 255 255 } else { 256 256 mutex_lock(&nf_log_mutex);
+3 -3
net/netfilter/nf_queue.c
··· 40 40 else if (old) 41 41 ret = -EBUSY; 42 42 else { 43 - rcu_assign_pointer(queue_handler[pf], qh); 43 + RCU_INIT_POINTER(queue_handler[pf], qh); 44 44 ret = 0; 45 45 } 46 46 mutex_unlock(&queue_handler_mutex); ··· 65 65 return -EINVAL; 66 66 } 67 67 68 - rcu_assign_pointer(queue_handler[pf], NULL); 68 + RCU_INIT_POINTER(queue_handler[pf], NULL); 69 69 mutex_unlock(&queue_handler_mutex); 70 70 71 71 synchronize_rcu(); ··· 84 84 queue_handler[pf], 85 85 lockdep_is_held(&queue_handler_mutex) 86 86 ) == qh) 87 - rcu_assign_pointer(queue_handler[pf], NULL); 87 + RCU_INIT_POINTER(queue_handler[pf], NULL); 88 88 } 89 89 mutex_unlock(&queue_handler_mutex); 90 90
+3 -3
net/netfilter/nfnetlink.c
··· 59 59 nfnl_unlock(); 60 60 return -EBUSY; 61 61 } 62 - rcu_assign_pointer(subsys_table[n->subsys_id], n); 62 + RCU_INIT_POINTER(subsys_table[n->subsys_id], n); 63 63 nfnl_unlock(); 64 64 65 65 return 0; ··· 210 210 if (!nfnl) 211 211 return -ENOMEM; 212 212 net->nfnl_stash = nfnl; 213 - rcu_assign_pointer(net->nfnl, nfnl); 213 + RCU_INIT_POINTER(net->nfnl, nfnl); 214 214 return 0; 215 215 } 216 216 ··· 219 219 struct net *net; 220 220 221 221 list_for_each_entry(net, net_exit_list, exit_list) 222 - rcu_assign_pointer(net->nfnl, NULL); 222 + RCU_INIT_POINTER(net->nfnl, NULL); 223 223 synchronize_net(); 224 224 list_for_each_entry(net, net_exit_list, exit_list) 225 225 netlink_kernel_release(net->nfnl_stash);
+3 -3
net/netlabel/netlabel_domainhash.c
··· 282 282 INIT_LIST_HEAD(&hsh_tbl->tbl[iter]); 283 283 284 284 spin_lock(&netlbl_domhsh_lock); 285 - rcu_assign_pointer(netlbl_domhsh, hsh_tbl); 285 + RCU_INIT_POINTER(netlbl_domhsh, hsh_tbl); 286 286 spin_unlock(&netlbl_domhsh_lock); 287 287 288 288 return 0; ··· 330 330 &rcu_dereference(netlbl_domhsh)->tbl[bkt]); 331 331 } else { 332 332 INIT_LIST_HEAD(&entry->list); 333 - rcu_assign_pointer(netlbl_domhsh_def, entry); 333 + RCU_INIT_POINTER(netlbl_domhsh_def, entry); 334 334 } 335 335 336 336 if (entry->type == NETLBL_NLTYPE_ADDRSELECT) { ··· 451 451 if (entry != rcu_dereference(netlbl_domhsh_def)) 452 452 list_del_rcu(&entry->list); 453 453 else 454 - rcu_assign_pointer(netlbl_domhsh_def, NULL); 454 + RCU_INIT_POINTER(netlbl_domhsh_def, NULL); 455 455 } else 456 456 ret_val = -ENOENT; 457 457 spin_unlock(&netlbl_domhsh_lock);
+3 -3
net/netlabel/netlabel_unlabeled.c
··· 354 354 INIT_LIST_HEAD(&iface->list); 355 355 if (netlbl_unlhsh_rcu_deref(netlbl_unlhsh_def) != NULL) 356 356 goto add_iface_failure; 357 - rcu_assign_pointer(netlbl_unlhsh_def, iface); 357 + RCU_INIT_POINTER(netlbl_unlhsh_def, iface); 358 358 } 359 359 spin_unlock(&netlbl_unlhsh_lock); 360 360 ··· 621 621 if (iface->ifindex > 0) 622 622 list_del_rcu(&iface->list); 623 623 else 624 - rcu_assign_pointer(netlbl_unlhsh_def, NULL); 624 + RCU_INIT_POINTER(netlbl_unlhsh_def, NULL); 625 625 spin_unlock(&netlbl_unlhsh_lock); 626 626 627 627 call_rcu(&iface->rcu, netlbl_unlhsh_free_iface); ··· 1449 1449 1450 1450 rcu_read_lock(); 1451 1451 spin_lock(&netlbl_unlhsh_lock); 1452 - rcu_assign_pointer(netlbl_unlhsh, hsh_tbl); 1452 + RCU_INIT_POINTER(netlbl_unlhsh, hsh_tbl); 1453 1453 spin_unlock(&netlbl_unlhsh_lock); 1454 1454 rcu_read_unlock(); 1455 1455
+2 -2
net/phonet/af_phonet.c
··· 480 480 if (proto_tab[protocol]) 481 481 err = -EBUSY; 482 482 else 483 - rcu_assign_pointer(proto_tab[protocol], pp); 483 + RCU_INIT_POINTER(proto_tab[protocol], pp); 484 484 mutex_unlock(&proto_tab_lock); 485 485 486 486 return err; ··· 491 491 { 492 492 mutex_lock(&proto_tab_lock); 493 493 BUG_ON(proto_tab[protocol] != pp); 494 - rcu_assign_pointer(proto_tab[protocol], NULL); 494 + RCU_INIT_POINTER(proto_tab[protocol], NULL); 495 495 mutex_unlock(&proto_tab_lock); 496 496 synchronize_rcu(); 497 497 proto_unregister(pp->prot);
+3 -3
net/phonet/pn_dev.c
··· 276 276 mutex_lock(&pnn->routes.lock); 277 277 for (i = 0; i < 64; i++) 278 278 if (dev == pnn->routes.table[i]) { 279 - rcu_assign_pointer(pnn->routes.table[i], NULL); 279 + RCU_INIT_POINTER(pnn->routes.table[i], NULL); 280 280 set_bit(i, deleted); 281 281 } 282 282 mutex_unlock(&pnn->routes.lock); ··· 390 390 daddr = daddr >> 2; 391 391 mutex_lock(&routes->lock); 392 392 if (routes->table[daddr] == NULL) { 393 - rcu_assign_pointer(routes->table[daddr], dev); 393 + RCU_INIT_POINTER(routes->table[daddr], dev); 394 394 dev_hold(dev); 395 395 err = 0; 396 396 } ··· 406 406 daddr = daddr >> 2; 407 407 mutex_lock(&routes->lock); 408 408 if (dev == routes->table[daddr]) 409 - rcu_assign_pointer(routes->table[daddr], NULL); 409 + RCU_INIT_POINTER(routes->table[daddr], NULL); 410 410 else 411 411 dev = NULL; 412 412 mutex_unlock(&routes->lock);
+3 -3
net/phonet/socket.c
··· 679 679 mutex_lock(&resource_mutex); 680 680 if (pnres.sk[res] == NULL) { 681 681 sock_hold(sk); 682 - rcu_assign_pointer(pnres.sk[res], sk); 682 + RCU_INIT_POINTER(pnres.sk[res], sk); 683 683 ret = 0; 684 684 } 685 685 mutex_unlock(&resource_mutex); ··· 695 695 696 696 mutex_lock(&resource_mutex); 697 697 if (pnres.sk[res] == sk) { 698 - rcu_assign_pointer(pnres.sk[res], NULL); 698 + RCU_INIT_POINTER(pnres.sk[res], NULL); 699 699 ret = 0; 700 700 } 701 701 mutex_unlock(&resource_mutex); ··· 714 714 mutex_lock(&resource_mutex); 715 715 for (res = 0; res < 256; res++) { 716 716 if (pnres.sk[res] == sk) { 717 - rcu_assign_pointer(pnres.sk[res], NULL); 717 + RCU_INIT_POINTER(pnres.sk[res], NULL); 718 718 match++; 719 719 } 720 720 }
+2 -2
net/socket.c
··· 2463 2463 lockdep_is_held(&net_family_lock))) 2464 2464 err = -EEXIST; 2465 2465 else { 2466 - rcu_assign_pointer(net_families[ops->family], ops); 2466 + RCU_INIT_POINTER(net_families[ops->family], ops); 2467 2467 err = 0; 2468 2468 } 2469 2469 spin_unlock(&net_family_lock); ··· 2491 2491 BUG_ON(family < 0 || family >= NPROTO); 2492 2492 2493 2493 spin_lock(&net_family_lock); 2494 - rcu_assign_pointer(net_families[family], NULL); 2494 + RCU_INIT_POINTER(net_families[family], NULL); 2495 2495 spin_unlock(&net_family_lock); 2496 2496 2497 2497 synchronize_rcu();
+2 -2
net/sunrpc/auth_gss/auth_gss.c
··· 122 122 if (!test_bit(RPCAUTH_CRED_NEW, &cred->cr_flags)) 123 123 return; 124 124 gss_get_ctx(ctx); 125 - rcu_assign_pointer(gss_cred->gc_ctx, ctx); 125 + RCU_INIT_POINTER(gss_cred->gc_ctx, ctx); 126 126 set_bit(RPCAUTH_CRED_UPTODATE, &cred->cr_flags); 127 127 smp_mb__before_clear_bit(); 128 128 clear_bit(RPCAUTH_CRED_NEW, &cred->cr_flags); ··· 970 970 struct gss_auth *gss_auth = container_of(cred->cr_auth, struct gss_auth, rpc_auth); 971 971 struct gss_cl_ctx *ctx = gss_cred->gc_ctx; 972 972 973 - rcu_assign_pointer(gss_cred->gc_ctx, NULL); 973 + RCU_INIT_POINTER(gss_cred->gc_ctx, NULL); 974 974 call_rcu(&cred->cr_rcu, gss_free_cred_callback); 975 975 if (ctx) 976 976 gss_put_ctx(ctx);
+2 -2
net/xfrm/xfrm_user.c
··· 2927 2927 if (nlsk == NULL) 2928 2928 return -ENOMEM; 2929 2929 net->xfrm.nlsk_stash = nlsk; /* Don't set to NULL */ 2930 - rcu_assign_pointer(net->xfrm.nlsk, nlsk); 2930 + RCU_INIT_POINTER(net->xfrm.nlsk, nlsk); 2931 2931 return 0; 2932 2932 } 2933 2933 ··· 2935 2935 { 2936 2936 struct net *net; 2937 2937 list_for_each_entry(net, net_exit_list, exit_list) 2938 - rcu_assign_pointer(net->xfrm.nlsk, NULL); 2938 + RCU_INIT_POINTER(net->xfrm.nlsk, NULL); 2939 2939 synchronize_net(); 2940 2940 list_for_each_entry(net, net_exit_list, exit_list) 2941 2941 netlink_kernel_release(net->xfrm.nlsk_stash);