aboutsummaryrefslogtreecommitdiffstats
path: root/net/decnet/dn_dev.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/decnet/dn_dev.c')
-rw-r--r--net/decnet/dn_dev.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/net/decnet/dn_dev.c b/net/decnet/dn_dev.c
index 4c27615340dc..cf26ac74a188 100644
--- a/net/decnet/dn_dev.c
+++ b/net/decnet/dn_dev.c
@@ -747,7 +747,8 @@ static int dn_nl_dump_ifaddr(struct sk_buff *skb, struct netlink_callback *cb)
747 skip_naddr = cb->args[1]; 747 skip_naddr = cb->args[1];
748 748
749 idx = 0; 749 idx = 0;
750 for_each_netdev(&init_net, dev) { 750 rcu_read_lock();
751 for_each_netdev_rcu(&init_net, dev) {
751 if (idx < skip_ndevs) 752 if (idx < skip_ndevs)
752 goto cont; 753 goto cont;
753 else if (idx > skip_ndevs) { 754 else if (idx > skip_ndevs) {
@@ -756,11 +757,11 @@ static int dn_nl_dump_ifaddr(struct sk_buff *skb, struct netlink_callback *cb)
756 skip_naddr = 0; 757 skip_naddr = 0;
757 } 758 }
758 759
759 if ((dn_db = rtnl_dereference(dev->dn_ptr)) == NULL) 760 if ((dn_db = rcu_dereference(dev->dn_ptr)) == NULL)
760 goto cont; 761 goto cont;
761 762
762 for (ifa = rtnl_dereference(dn_db->ifa_list), dn_idx = 0; ifa; 763 for (ifa = rcu_dereference(dn_db->ifa_list), dn_idx = 0; ifa;
763 ifa = rtnl_dereference(ifa->ifa_next), dn_idx++) { 764 ifa = rcu_dereference(ifa->ifa_next), dn_idx++) {
764 if (dn_idx < skip_naddr) 765 if (dn_idx < skip_naddr)
765 continue; 766 continue;
766 767
@@ -773,6 +774,7 @@ cont:
773 idx++; 774 idx++;
774 } 775 }
775done: 776done:
777 rcu_read_unlock();
776 cb->args[0] = idx; 778 cb->args[0] = idx;
777 cb->args[1] = dn_idx; 779 cb->args[1] = dn_idx;
778 780