summaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorCong Wang <amwang@redhat.com>2013-01-17 12:21:08 +0800
committerDavid S. Miller <davem@davemloft.net>2013-01-16 23:33:06 -0500
commit5bd30d398792eb6351da2087fe81bbf755900991 (patch)
tree035a97bc084cb3b7a01bce30571cbb3301953d3f /net/core
parent07f623d3b278abe88508c1c59d7c1089b4a56789 (diff)
netpoll: fix a missing dev refcounting
__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> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/netpoll.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/core/netpoll.c b/net/core/netpoll.c
index a5ad1c1c4b1..a9b10048388 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);