diff options
author | Alex Vesker <valex@mellanox.com> | 2016-07-25 12:42:13 (GMT) |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-07-26 01:00:25 (GMT) |
commit | 9b022a6e0f26af108b9105b16b310393c898d9bd (patch) | |
tree | ea15502553b9bc73aa5de750ad99b6191bf09f35 /drivers/net | |
parent | 86cb13e4ec5060d94069a8418fd4f3ccb38edee2 (diff) | |
download | linux-9b022a6e0f26af108b9105b16b310393c898d9bd.tar.xz |
net/mlx4_core: Check device state before unregistering it
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: 225c7b1feef1 ("IB/mlx4: Add a driver Mellanox ConnectX InfiniBand adapters")
Signed-off-by: Alex Vesker <valex@mellanox.com>
Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx4/intf.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/intf.c b/drivers/net/ethernet/mellanox/mlx4/intf.c index 7ae1cda..0e8b7c4 100644 --- a/drivers/net/ethernet/mellanox/mlx4/intf.c +++ b/drivers/net/ethernet/mellanox/mlx4/intf.c @@ -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); |