diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2009-11-04 13:59:38 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-11-04 13:59:38 -0500 |
commit | b4d745db12bd2d45a456565ed63325bbfc689e68 (patch) | |
tree | 2fdee34d2a383bd4891e038bd8e5fb3245cc4aba /net/decnet | |
parent | d94d9fee9fa4e66a0b91640a694b8b10177075b3 (diff) |
decnet: avoid touching device refcount in dn_dev_by_index()
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/decnet')
-rw-r--r-- | net/decnet/dn_dev.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/net/decnet/dn_dev.c b/net/decnet/dn_dev.c index 6e1f085db06..d82694d930b 100644 --- a/net/decnet/dn_dev.c +++ b/net/decnet/dn_dev.c | |||
@@ -600,15 +600,17 @@ static void dn_dev_check_default(struct net_device *dev) | |||
600 | dev_put(dev); | 600 | dev_put(dev); |
601 | } | 601 | } |
602 | 602 | ||
603 | /* | ||
604 | * Called with RTNL | ||
605 | */ | ||
603 | static struct dn_dev *dn_dev_by_index(int ifindex) | 606 | static struct dn_dev *dn_dev_by_index(int ifindex) |
604 | { | 607 | { |
605 | struct net_device *dev; | 608 | struct net_device *dev; |
606 | struct dn_dev *dn_dev = NULL; | 609 | struct dn_dev *dn_dev = NULL; |
607 | dev = dev_get_by_index(&init_net, ifindex); | 610 | |
608 | if (dev) { | 611 | dev = __dev_get_by_index(&init_net, ifindex); |
612 | if (dev) | ||
609 | dn_dev = dev->dn_ptr; | 613 | dn_dev = dev->dn_ptr; |
610 | dev_put(dev); | ||
611 | } | ||
612 | 614 | ||
613 | return dn_dev; | 615 | return dn_dev; |
614 | } | 616 | } |