Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 352408
b: refs/heads/master
c: 0790bbb
h: refs/heads/master
v: v3
  • Loading branch information
Neil Horman authored and David S. Miller committed Feb 12, 2013
1 parent 1953c65 commit 2a8126f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2cde6acd49daca58b96f1fbc697492825511ad31
refs/heads/master: 0790bbb68f9d483348c1d65381f3dd92602bfd05
12 changes: 8 additions & 4 deletions trunk/net/core/netpoll.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ static void netpoll_poll_dev(struct net_device *dev)
* the dev_open/close paths use this to block netpoll activity
* while changing device state
*/
if (!mutex_trylock(&dev->npinfo->dev_lock))
if (!mutex_trylock(&ni->dev_lock))
return;

if (!dev || !netif_running(dev))
Expand All @@ -221,7 +221,7 @@ static void netpoll_poll_dev(struct net_device *dev)

poll_napi(dev);

mutex_unlock(&dev->npinfo->dev_lock);
mutex_unlock(&ni->dev_lock);

if (dev->flags & IFF_SLAVE) {
if (ni) {
Expand Down Expand Up @@ -1056,7 +1056,7 @@ int __netpoll_setup(struct netpoll *np, struct net_device *ndev, gfp_t gfp)
goto free_npinfo;
}
} else {
npinfo = ndev->npinfo;
npinfo = rtnl_dereference(ndev->npinfo);
atomic_inc(&npinfo->refcnt);
}

Expand Down Expand Up @@ -1236,7 +1236,11 @@ void __netpoll_cleanup(struct netpoll *np)
struct netpoll_info *npinfo;
unsigned long flags;

npinfo = np->dev->npinfo;
/* rtnl_dereference would be preferable here but
* rcu_cleanup_netpoll path can put us in here safely without
* holding the rtnl, so plain rcu_dereference it is
*/
npinfo = rtnl_dereference(np->dev->npinfo);
if (!npinfo)
return;

Expand Down

0 comments on commit 2a8126f

Please sign in to comment.