Commit 5fa5ae60 authored by Eric Dumazet's avatar Eric Dumazet Committed by Jakub Kicinski

netpoll: add net device refcount tracker to struct netpoll

Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 42120a86
...@@ -721,7 +721,7 @@ static int netconsole_netdev_event(struct notifier_block *this, ...@@ -721,7 +721,7 @@ static int netconsole_netdev_event(struct notifier_block *this,
__netpoll_cleanup(&nt->np); __netpoll_cleanup(&nt->np);
spin_lock_irqsave(&target_list_lock, flags); spin_lock_irqsave(&target_list_lock, flags);
dev_put(nt->np.dev); dev_put_track(nt->np.dev, &nt->np.dev_tracker);
nt->np.dev = NULL; nt->np.dev = NULL;
nt->enabled = false; nt->enabled = false;
stopped = true; stopped = true;
......
...@@ -24,6 +24,7 @@ union inet_addr { ...@@ -24,6 +24,7 @@ union inet_addr {
struct netpoll { struct netpoll {
struct net_device *dev; struct net_device *dev;
netdevice_tracker dev_tracker;
char dev_name[IFNAMSIZ]; char dev_name[IFNAMSIZ];
const char *name; const char *name;
......
...@@ -776,7 +776,7 @@ int netpoll_setup(struct netpoll *np) ...@@ -776,7 +776,7 @@ int netpoll_setup(struct netpoll *np)
err = __netpoll_setup(np, ndev); err = __netpoll_setup(np, ndev);
if (err) if (err)
goto put; goto put;
netdev_tracker_alloc(ndev, &np->dev_tracker, GFP_KERNEL);
rtnl_unlock(); rtnl_unlock();
return 0; return 0;
...@@ -853,7 +853,7 @@ void netpoll_cleanup(struct netpoll *np) ...@@ -853,7 +853,7 @@ void netpoll_cleanup(struct netpoll *np)
if (!np->dev) if (!np->dev)
goto out; goto out;
__netpoll_cleanup(np); __netpoll_cleanup(np);
dev_put(np->dev); dev_put_track(np->dev, &np->dev_tracker);
np->dev = NULL; np->dev = NULL;
out: out:
rtnl_unlock(); rtnl_unlock();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment