* [Patch net-next] netpoll: fix a missing dev refcounting
@ 2013-01-17 4:21 Cong Wang
2013-01-17 4:33 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Cong Wang @ 2013-01-17 4:21 UTC (permalink / raw)
To: netdev; +Cc: Eric Dumazet, Jiri Pirko, David S. Miller, Cong Wang
__dev_get_by_name() doesn't refcount the network device,
so we have to do this by ourselves. Noticed by Eric.
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Jiri Pirko <jiri@resnulli.us>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Cong Wang <amwang@redhat.com>
---
diff --git a/net/core/netpoll.c b/net/core/netpoll.c
index a5ad1c1..a9b1004 100644
--- a/net/core/netpoll.c
+++ b/net/core/netpoll.c
@@ -1056,6 +1056,7 @@ int netpoll_setup(struct netpoll *np)
err = -ENODEV;
goto unlock;
}
+ dev_hold(ndev);
if (netdev_master_upper_dev_get(ndev)) {
np_err(np, "%s is a slave device, aborting\n", np->dev_name);
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-01-17 4:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-17 4:21 [Patch net-next] netpoll: fix a missing dev refcounting Cong Wang
2013-01-17 4:33 ` 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).