netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] net/mlx4_core: Check device state before unregistering it
@ 2016-07-25 12:42 Tariq Toukan
  2016-07-26  1:00 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Tariq Toukan @ 2016-07-25 12:42 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Eran Ben Elisha, Alex Vesker, Tariq Toukan

From: Alex Vesker <valex@mellanox.com>

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>
---
 drivers/net/ethernet/mellanox/mlx4/intf.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/ethernet/mellanox/mlx4/intf.c b/drivers/net/ethernet/mellanox/mlx4/intf.c
index dec77d6f0ac9..5aeb6027b70e 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);
 
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net] net/mlx4_core: Check device state before unregistering it
  2016-07-25 12:42 [PATCH net] net/mlx4_core: Check device state before unregistering it Tariq Toukan
@ 2016-07-26  1:00 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2016-07-26  1:00 UTC (permalink / raw)
  To: tariqt; +Cc: netdev, eranbe, valex

From: Tariq Toukan <tariqt@mellanox.com>
Date: Mon, 25 Jul 2016 15:42:13 +0300

> From: Alex Vesker <valex@mellanox.com>
> 
> 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>

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-07-26  1:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-25 12:42 [PATCH net] net/mlx4_core: Check device state before unregistering it Tariq Toukan
2016-07-26  1:00 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).