Skip to content

Commit

Permalink
net/mlx4_core: Check device state before unregistering it
Browse files Browse the repository at this point in the history
Verify that the device state is registered before un-registering it.
This check is required to prevent an OOPS on flows that do
re-registration of the device and its previous state was
unregistered.

Fixes: 225c7b1 ("IB/mlx4: Add a driver Mellanox ConnectX InfiniBand adapters")
Signed-off-by: Alex Vesker <[email protected]>
Signed-off-by: Tariq Toukan <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
alexvesker authored and davem330 committed Jul 26, 2016
1 parent 86cb13e commit 9b022a6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/net/ethernet/mellanox/mlx4/intf.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,9 @@ void mlx4_unregister_device(struct mlx4_dev *dev)
struct mlx4_priv *priv = mlx4_priv(dev);
struct mlx4_interface *intf;

if (!(dev->persist->interface_state & MLX4_INTERFACE_STATE_UP))
return;

mlx4_stop_catas_poll(dev);
mutex_lock(&intf_mutex);

Expand Down

0 comments on commit 9b022a6

Please sign in to comment.