Skip to content

Commit

Permalink
RDMA/i40iw: Fix incorrect iterator type
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Håkon Bugge authored and Jason Gunthorpe committed Sep 19, 2018
1 parent 6ebce44 commit 802fa45
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/infiniband/hw/i40iw/i40iw_cm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit 802fa45

Please sign in to comment.