diff options
author | Moni Shoua <monis@mellanox.com> | 2015-03-18 10:51:35 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-03-18 15:17:11 -0400 |
commit | 217e8b16a43a1780e77607dc019c5f3b26fab48a (patch) | |
tree | a0facea5a2aef70d76194d901c52b28dc43df753 | |
parent | ced585c83b27deca427c606a34dd3eaa6b96d82b (diff) |
IB/mlx4: Verify net device validity on port change event
Processing an event is done in a different context from the one when
the event was dispatched. This requires a check that the slave
net device is still valid when the event is being processed. The check is done
under the iboe lock which ensure correctness.
Fixes: a57500903093 ('IB/mlx4: Add port aggregation support')
Signed-off-by: Moni Shoua <monis@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/infiniband/hw/mlx4/main.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c index ac6e2b710ea6..b972c0b41799 100644 --- a/drivers/infiniband/hw/mlx4/main.c +++ b/drivers/infiniband/hw/mlx4/main.c | |||
@@ -2697,8 +2697,12 @@ static void handle_bonded_port_state_event(struct work_struct *work) | |||
2697 | spin_lock_bh(&ibdev->iboe.lock); | 2697 | spin_lock_bh(&ibdev->iboe.lock); |
2698 | for (i = 0; i < MLX4_MAX_PORTS; ++i) { | 2698 | for (i = 0; i < MLX4_MAX_PORTS; ++i) { |
2699 | struct net_device *curr_netdev = ibdev->iboe.netdevs[i]; | 2699 | struct net_device *curr_netdev = ibdev->iboe.netdevs[i]; |
2700 | enum ib_port_state curr_port_state; | ||
2700 | 2701 | ||
2701 | enum ib_port_state curr_port_state = | 2702 | if (!curr_netdev) |
2703 | continue; | ||
2704 | |||
2705 | curr_port_state = | ||
2702 | (netif_running(curr_netdev) && | 2706 | (netif_running(curr_netdev) && |
2703 | netif_carrier_ok(curr_netdev)) ? | 2707 | netif_carrier_ok(curr_netdev)) ? |
2704 | IB_PORT_ACTIVE : IB_PORT_DOWN; | 2708 | IB_PORT_ACTIVE : IB_PORT_DOWN; |