RDMA/i40iw: Fix incorrect iterator type
authorHåkon Bugge <Haakon.Bugge@oracle.com>
Mon, 17 Sep 2018 14:07:07 +0000 (16:07 +0200)
committerJason Gunthorpe <jgg@mellanox.com>
Wed, 19 Sep 2018 16:08:20 +0000 (10:08 -0600)
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.

Signed-off-by: Håkon Bugge <haakon.bugge@oracle.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/i40iw/i40iw_cm.c

index 423818a..771eb6b 100644 (file)
@@ -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)) {