diff mbox

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

Message ID 1344871635-1052-8-git-send-email-jiri@resnulli.us (mailing list archive)
State Not Applicable
Headers show

Commit Message

Jiri Pirko Aug. 13, 2012, 3:27 p.m. UTC
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
---
 net/core/netpoll.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
diff mbox

Patch

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;