netlabel: remove dev_put() calls
authorEric Dumazet <eric.dumazet@gmail.com>
Fri, 6 Nov 2009 04:53:47 +0000 (20:53 -0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 6 Nov 2009 06:34:18 +0000 (22:34 -0800)
Use dev_get_by_name_rcu() to avoid dev_put() calls,
in sections already inside a rcu_read_lock()

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/netlabel/netlabel_unlabeled.c

index fb357f010189ec12b70de5b3677aea7169874e6c..3dfe2bac8623397b0ca081a845925d8190c0e5be 100644 (file)
@@ -472,13 +472,12 @@ int netlbl_unlhsh_add(struct net *net,
 
        rcu_read_lock();
        if (dev_name != NULL) {
-               dev = dev_get_by_name(net, dev_name);
+               dev = dev_get_by_name_rcu(net, dev_name);
                if (dev == NULL) {
                        ret_val = -ENODEV;
                        goto unlhsh_add_return;
                }
                ifindex = dev->ifindex;
-               dev_put(dev);
                iface = netlbl_unlhsh_search_iface(ifindex);
        } else {
                ifindex = 0;
@@ -737,13 +736,12 @@ int netlbl_unlhsh_remove(struct net *net,
 
        rcu_read_lock();
        if (dev_name != NULL) {
-               dev = dev_get_by_name(net, dev_name);
+               dev = dev_get_by_name_rcu(net, dev_name);
                if (dev == NULL) {
                        ret_val = -ENODEV;
                        goto unlhsh_remove_return;
                }
                iface = netlbl_unlhsh_search_iface(dev->ifindex);
-               dev_put(dev);
        } else
                iface = rcu_dereference(netlbl_unlhsh_def);
        if (iface == NULL) {