Skip to content

Commit 802fa45

Browse files
Hakon-Buggejgunthorpe
authored andcommitted
RDMA/i40iw: Fix incorrect iterator type
Commit f27b474 ("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. Signed-off-by: Håkon Bugge <haakon.bugge@oracle.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
1 parent 6ebce44 commit 802fa45

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/infiniband/hw/i40iw/i40iw_cm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1689,7 +1689,7 @@ static enum i40iw_status_code i40iw_add_mqh_6(struct i40iw_device *iwdev,
16891689
unsigned long flags;
16901690

16911691
rtnl_lock();
1692-
for_each_netdev_rcu(&init_net, ip_dev) {
1692+
for_each_netdev(&init_net, ip_dev) {
16931693
if ((((rdma_vlan_dev_vlan_id(ip_dev) < I40IW_NO_VLAN) &&
16941694
(rdma_vlan_dev_real_dev(ip_dev) == iwdev->netdev)) ||
16951695
(ip_dev == iwdev->netdev)) && (ip_dev->flags & IFF_UP)) {

0 commit comments

Comments
 (0)