netpoll: fix a missing dev refcounting
Subsystems (2)
PATCH 1/1 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 <[email protected]>
Cc Jiri Pirko <[email protected]>
Cc David S. Miller <[email protected]>
Signed-off-by Cong Wang <[email protected]>
---
net/core/netpoll.c +1 -0
@@ -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);
From: Cong Wang <[email protected]>
Date: Thu, 17 Jan 2013 12:21:08 +0800
Quoted 7 lines
__dev_get_by_name()doesn't refcount the network device, so we have to do this by ourselves. Noticed by Eric.Cc Eric Dumazet <[email protected]>Cc Jiri Pirko <[email protected]>Cc David S. Miller <[email protected]>Signed-off-by Cong Wang <[email protected]>
Applied.