* [PATCH net-next-2.6] decnet: avoid touching device refcount in dn_dev_by_index()
@ 2009-11-04 18:15 Eric Dumazet
2009-11-04 18:59 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Eric Dumazet @ 2009-11-04 18:15 UTC (permalink / raw)
To: David S. Miller; +Cc: Linux Netdev List
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---
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 6e1f085..d566e98 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;
}
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-next-2.6] decnet: avoid touching device refcount in dn_dev_by_index()
2009-11-04 18:15 [PATCH net-next-2.6] decnet: avoid touching device refcount in dn_dev_by_index() Eric Dumazet
@ 2009-11-04 18:59 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2009-11-04 18:59 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Wed, 04 Nov 2009 19:15:14 +0100
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Applied, thanks Eric.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-11-04 18:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-04 18:15 [PATCH net-next-2.6] decnet: avoid touching device refcount in dn_dev_by_index() Eric Dumazet
2009-11-04 18:59 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).