Skip to content

Commit

Permalink
Revert "netpoll: Fix extra refcount release in netpoll_cleanup()"
Browse files Browse the repository at this point in the history
This reverts commit 543e3a8.

Direct callers of __netpoll_setup() depend on it to set np->dev,
so we can't simply move that assignment up to netpoll_stup().

Reported-by: Bart Van Assche <bart.vanassche@sandisk.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
bjorn-helgaas authored and davem330 committed Apr 5, 2016
1 parent aa4f069 commit 727ceaa
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions net/core/netpoll.c
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,7 @@ int __netpoll_setup(struct netpoll *np, struct net_device *ndev)
const struct net_device_ops *ops;
int err;

np->dev = ndev;
strlcpy(np->dev_name, ndev->name, IFNAMSIZ);
INIT_WORK(&np->cleanup_work, netpoll_async_cleanup);

Expand Down Expand Up @@ -669,7 +670,6 @@ int netpoll_setup(struct netpoll *np)
goto unlock;
}
dev_hold(ndev);
np->dev = ndev;

if (netdev_master_upper_dev_get(ndev)) {
np_err(np, "%s is a slave device, aborting\n", np->dev_name);
Expand Down Expand Up @@ -770,7 +770,6 @@ int netpoll_setup(struct netpoll *np)
return 0;

put:
np->dev = NULL;
dev_put(ndev);
unlock:
rtnl_unlock();
Expand Down

0 comments on commit 727ceaa

Please sign in to comment.