Skip to contentSkip to conversation

RDMA/i40iw: Fix incorrect iterator type

PATCH Applied Håkon Bugge 3 participants 3 messages Sep 17, 2018 – Sep 23, 2018 InfiniBand

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 RDMA/i40iw: Fix incorrect iterator type

Commit f27b4746f378 ("i40iw: add connection management code") uses an incorrect rcu iterator, whilst holding the rtnl_lock. Since the critical region invokes i40iw_manage_qhash(), which is a sleeping function, the rcu locking and traversal cannot be used.

---
 drivers/infiniband/hw/i40iw/i40iw_cm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/hw/i40iw/i40iw_cm.c +1 -1
index 423818a7d333..771eb6bd0785 100644
@@ -1689,7 +1689,7 @@ static enum i40iw_status_code i40iw_add_mqh_6(struct i40iw_device *iwdev,
 	unsigned long flags;
 
 	rtnl_lock();
-	for_each_netdev_rcu(&init_net, ip_dev) {
+	for_each_netdev(&init_net, ip_dev) {
 		if ((((rdma_vlan_dev_vlan_id(ip_dev) < I40IW_NO_VLAN) &&
 		      (rdma_vlan_dev_real_dev(ip_dev) == iwdev->netdev)) ||
 		     (ip_dev == iwdev->netdev)) && (ip_dev->flags & IFF_UP)) {
Signature · 1 line
2.14.3
#1 lore raw
Quoted 9 lines · Håkon Bugge

Commit f27b4746f378 ("i40iw: add connection management code") uses an incorrect rcu iterator, whilst holding the rtnl_lock. Since the critical region invokes i40iw_manage_qhash(), which is a sleeping function, the rcu locking and traversal cannot be used.

---
 drivers/infiniband/hw/i40iw/i40iw_cm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied to for-next, thanks

Jason

Acked-by on v1 1/1
#2 lore raw
In reply to Håkon Bugge
Quoted 11 lines

Subject: [PATCH] RDMA/i40iw: Fix incorrect iterator type

Commit f27b4746f378 ("i40iw: add connection management code") uses an incorrect rcu iterator, whilst holding the rtnl_lock. Since the critical region invokes i40iw_manage_qhash(), which is a sleeping function, the rcu locking and traversal cannot be used.

---
drivers/infiniband/hw/i40iw/i40iw_cm.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)

Thanks doing this Hakon!