mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 11:46:19 +00:00
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>
This commit is contained in:
parent
d94d9fee9f
commit
b4d745db12
1 changed files with 6 additions and 4 deletions
|
@ -600,15 +600,17 @@ static void dn_dev_check_default(struct net_device *dev)
|
||||||
dev_put(dev);
|
dev_put(dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Called with RTNL
|
||||||
|
*/
|
||||||
static struct dn_dev *dn_dev_by_index(int ifindex)
|
static struct dn_dev *dn_dev_by_index(int ifindex)
|
||||||
{
|
{
|
||||||
struct net_device *dev;
|
struct net_device *dev;
|
||||||
struct dn_dev *dn_dev = NULL;
|
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;
|
dn_dev = dev->dn_ptr;
|
||||||
dev_put(dev);
|
|
||||||
}
|
|
||||||
|
|
||||||
return dn_dev;
|
return dn_dev;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue