cxgb3: remove usage of dev->master
authorJiri Pirko <jiri@resnulli.us>
Thu, 3 Jan 2013 22:48:56 +0000 (22:48 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 4 Jan 2013 21:31:50 +0000 (13:31 -0800)
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c

index 942dace361d229e061545c51340f9fb37d194dd7..3f1f5018c66e7276185aeffb766e474870cd6763 100644 (file)
@@ -182,14 +182,17 @@ static struct net_device *get_iff_from_mac(struct adapter *adapter,
                struct net_device *dev = adapter->port[i];
 
                if (!memcmp(dev->dev_addr, mac, ETH_ALEN)) {
+                       rcu_read_lock();
                        if (vlan && vlan != VLAN_VID_MASK) {
-                               rcu_read_lock();
                                dev = __vlan_find_dev_deep(dev, vlan);
-                               rcu_read_unlock();
                        } else if (netif_is_bond_slave(dev)) {
-                               while (dev->master)
-                                       dev = dev->master;
+                               struct net_device *upper_dev;
+
+                               while ((upper_dev =
+                                       netdev_master_upper_dev_get_rcu(dev)))
+                                       dev = upper_dev;
                        }
+                       rcu_read_unlock();
                        return dev;
                }
        }