lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1357289343-817-9-git-send-email-jiri@resnulli.us>
Date:	Fri,  4 Jan 2013 09:48:56 +0100
From:	Jiri Pirko <jiri@...nulli.us>
To:	netdev@...r.kernel.org
Cc:	davem@...emloft.net, edumazet@...gle.com, faisal.latif@...el.com,
	roland@...nel.org, sean.hefty@...el.com, hal.rosenstock@...il.com,
	fubar@...ibm.com, andy@...yhouse.net, divy@...lsio.com,
	jitendra.kalsaria@...gic.com, sony.chacko@...gic.com,
	linux-driver@...gic.com, kaber@...sh.net, ursula.braun@...ibm.com,
	blaschka@...ux.vnet.ibm.com, linux390@...ibm.com,
	shemminger@...tta.com, bhutchings@...arflare.com,
	therbert@...gle.com, xiyou.wangcong@...il.com, joe@...ches.com,
	gregory.v.rose@...el.com, john.r.fastabend@...el.com,
	linux-rdma@...r.kernel.org, linux-kernel@...r.kernel.org,
	linux-s390@...r.kernel.org, bridge@...ts.linux-foundation.org,
	fbl@...hat.com
Subject: [patch net-next V6 08/15] cxgb3: remove usage of dev->master

Signed-off-by: Jiri Pirko <jiri@...nulli.us>
---
 drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c b/drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c
index 942dace..3f1f501 100644
--- a/drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c
+++ b/drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c
@@ -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;
 		}
 	}
-- 
1.8.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ