Skip to content

Commit 37fbd83

Browse files
Mark Zhangdledford
authored andcommitted
IB/core: Fix oops in netdev_next_upper_dev_rcu()
When support for bonding of RoCE devices was added, there was necessarily a link between the RoCE device and the paired netdevice that was part of the bond. If you remove the mlx4_en module, that paired association is broken (the RoCE device is still present but the paired netdevice has been released). We need to account for this in is_upper_ndev_bond_master_filter() and filter out those links with a broken pairing or else we later oops in netdev_next_upper_dev_rcu(). Fixes: 408f124 ("IB/core: Delete lower netdevice default GID entries in bonding scenario") Signed-off-by: Mark Zhang <markz@mellanox.com> Reviewed-by: Parav Pandit <parav@mellanox.com> Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
1 parent 47f07f0 commit 37fbd83

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/infiniband/core/roce_gid_mgmt.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,9 @@ is_upper_ndev_bond_master_filter(struct ib_device *ib_dev, u8 port,
267267
struct net_device *cookie_ndev = cookie;
268268
bool match = false;
269269

270+
if (!rdma_ndev)
271+
return false;
272+
270273
rcu_read_lock();
271274
if (netif_is_bond_master(cookie_ndev) &&
272275
rdma_is_upper_dev_rcu(rdma_ndev, cookie_ndev))

0 commit comments

Comments
 (0)