提交 b4d745db 编写于 作者: E Eric Dumazet 提交者: David S. Miller

decnet: avoid touching device refcount in dn_dev_by_index()

Signed-off-by: NEric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 d94d9fee
...@@ -600,15 +600,17 @@ static void dn_dev_check_default(struct net_device *dev) ...@@ -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;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册