[VLAN]: Return proper error codes in register_vlan_device
[safe/jmp/linux-2.6] / net / bridge / br_netlink.c
index 5e84ade..0fcf6f0 100644 (file)
@@ -109,8 +109,8 @@ static int br_dump_ifinfo(struct sk_buff *skb, struct netlink_callback *cb)
        struct net_device *dev;
        int idx;
 
-       read_lock(&dev_base_lock);
-       for (dev = dev_base, idx = 0; dev; dev = dev->next) {
+       idx = 0;
+       for_each_netdev(dev) {
                /* not a bridge port */
                if (dev->br_port == NULL || idx < cb->args[0])
                        goto skip;
@@ -122,7 +122,6 @@ static int br_dump_ifinfo(struct sk_buff *skb, struct netlink_callback *cb)
 skip:
                ++idx;
        }
-       read_unlock(&dev_base_lock);
 
        cb->args[0] = idx;