From: Cong Wang Date: Thu, 17 Jan 2013 04:21:08 +0000 (+0800) Subject: netpoll: fix a missing dev refcounting X-Git-Tag: v3.9-rc1~139^2~351 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5bd30d398792eb6351da2087fe81bbf755900991;p=platform%2Fkernel%2Flinux-stable.git 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 Cc: Jiri Pirko Cc: David S. Miller Signed-off-by: Cong Wang Signed-off-by: David S. Miller --- 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);