[patch net-next 07/16] netpoll: remove usage of dev->master

Jiri Pirko
2012-08-13T15:27:06Z

net/core/netpoll.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/net/core/netpoll.c b/net/core/netpoll.c
index b4c90e4..5c8e560 100644
--- a/net/core/netpoll.c
+++ b/net/core/netpoll.c
@@ -207,12 +207,16 @@ static void netpoll_poll_dev(struct net_device *dev)

if (dev->flags & IFF_SLAVE) {
if (dev->npinfo) {
- struct net_device *bond_dev = dev->master;
+ struct net_device *bond_dev;
struct sk_buff *skb;
+
+ rcu_read_lock();
+ bond_dev = netdev_unique_upper_dev_get_rcu(dev);
while ((skb = skb_dequeue(&dev->npinfo->arp_tx))) {
skb->dev = bond_dev;
skb_queue_tail(&bond_dev->npinfo->arp_tx, skb);
}
+ rcu_read_unlock();
}
}

@@ -795,7 +799,7 @@ int netpoll_setup(struct netpoll *np)
return -ENODEV;
}

- if (ndev->master) {
+ if (netdev_unique_upper_dev_get(ndev)) {
np_err(np, "%s is a slave device, aborting\n", np->dev_name);
err = -EBUSY;
goto put;
--
1.7.10.4