diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2009-11-04 19:59:38 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-11-04 19:59:38 +0100 |
commit | b4d745db12bd2d45a456565ed63325bbfc689e68 (patch) | |
tree | 2fdee34d2a383bd4891e038bd8e5fb3245cc4aba /net/decnet/dn_dev.c | |
parent | net: cleanup include/linux (diff) | |
download | linux-b4d745db12bd2d45a456565ed63325bbfc689e68.tar.xz linux-b4d745db12bd2d45a456565ed63325bbfc689e68.zip |
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/dn_dev.c')
-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 6e1f085db06a..d82694d930b4 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) dev_put(dev); } +/* + * Called with RTNL + */ static struct dn_dev *dn_dev_by_index(int ifindex) { struct net_device *dev; struct dn_dev *dn_dev = NULL; - dev = dev_get_by_index(&init_net, ifindex); - if (dev) { + + dev = __dev_get_by_index(&init_net, ifindex); + if (dev) dn_dev = dev->dn_ptr; - dev_put(dev); - } return dn_dev; } |