diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2009-11-05 23:53:47 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-11-06 01:34:18 -0500 |
commit | 122ec6ffca3967ffaa96a4c7a5dc9cd71866e0bc (patch) | |
tree | 5e04166eaa0494a786fa5bb2c9c3628df03289ff /net/netlabel/netlabel_unlabeled.c | |
parent | 31ef30c760f7ddb133fa538df1dfbec1f42294d7 (diff) |
netlabel: remove dev_put() calls
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>
Diffstat (limited to 'net/netlabel/netlabel_unlabeled.c')
-rw-r--r-- | net/netlabel/netlabel_unlabeled.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/net/netlabel/netlabel_unlabeled.c b/net/netlabel/netlabel_unlabeled.c index fb357f010189..3dfe2bac8623 100644 --- a/net/netlabel/netlabel_unlabeled.c +++ b/net/netlabel/netlabel_unlabeled.c | |||
@@ -472,13 +472,12 @@ int netlbl_unlhsh_add(struct net *net, | |||
472 | 472 | ||
473 | rcu_read_lock(); | 473 | rcu_read_lock(); |
474 | if (dev_name != NULL) { | 474 | if (dev_name != NULL) { |
475 | dev = dev_get_by_name(net, dev_name); | 475 | dev = dev_get_by_name_rcu(net, dev_name); |
476 | if (dev == NULL) { | 476 | if (dev == NULL) { |
477 | ret_val = -ENODEV; | 477 | ret_val = -ENODEV; |
478 | goto unlhsh_add_return; | 478 | goto unlhsh_add_return; |
479 | } | 479 | } |
480 | ifindex = dev->ifindex; | 480 | ifindex = dev->ifindex; |
481 | dev_put(dev); | ||
482 | iface = netlbl_unlhsh_search_iface(ifindex); | 481 | iface = netlbl_unlhsh_search_iface(ifindex); |
483 | } else { | 482 | } else { |
484 | ifindex = 0; | 483 | ifindex = 0; |
@@ -737,13 +736,12 @@ int netlbl_unlhsh_remove(struct net *net, | |||
737 | 736 | ||
738 | rcu_read_lock(); | 737 | rcu_read_lock(); |
739 | if (dev_name != NULL) { | 738 | if (dev_name != NULL) { |
740 | dev = dev_get_by_name(net, dev_name); | 739 | dev = dev_get_by_name_rcu(net, dev_name); |
741 | if (dev == NULL) { | 740 | if (dev == NULL) { |
742 | ret_val = -ENODEV; | 741 | ret_val = -ENODEV; |
743 | goto unlhsh_remove_return; | 742 | goto unlhsh_remove_return; |
744 | } | 743 | } |
745 | iface = netlbl_unlhsh_search_iface(dev->ifindex); | 744 | iface = netlbl_unlhsh_search_iface(dev->ifindex); |
746 | dev_put(dev); | ||
747 | } else | 745 | } else |
748 | iface = rcu_dereference(netlbl_unlhsh_def); | 746 | iface = rcu_dereference(netlbl_unlhsh_def); |
749 | if (iface == NULL) { | 747 | if (iface == NULL) { |