net/mlx5e: Disable async events before unregister_netdev()
authorAchiad Shochat <achiad@mellanox.com>
Tue, 4 Aug 2015 11:05:45 +0000 (14:05 +0300)
committerDavid S. Miller <davem@davemloft.net>
Fri, 7 Aug 2015 05:00:58 +0000 (22:00 -0700)
It does not make sense to allow events while the netdev is
unregistered.

Signed-off-by: Achiad Shochat <achiad@mellanox.com>
Signed-off-by: Amir Vadai <amirv@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx5/core/en_main.c

index 33a0488dc14408b0f08f94f65100c6aa2d3d75c5..43696880626864f712c2f7753190e3cb6fec8c42 100644 (file)
@@ -2138,6 +2138,8 @@ static void mlx5e_destroy_netdev(struct mlx5_core_dev *mdev, void *vpriv)
        struct mlx5e_priv *priv = vpriv;
        struct net_device *netdev = priv->netdev;
 
+       mlx5e_disable_async_events(priv);
+       flush_scheduled_work();
        unregister_netdev(netdev);
        mlx5e_destroy_flow_tables(priv);
        mlx5e_destroy_tirs(priv);
@@ -2149,8 +2151,6 @@ static void mlx5e_destroy_netdev(struct mlx5_core_dev *mdev, void *vpriv)
        mlx5_dealloc_transport_domain(priv->mdev, priv->tdn);
        mlx5_core_dealloc_pd(priv->mdev, priv->pdn);
        mlx5_unmap_free_uar(priv->mdev, &priv->cq_uar);
-       mlx5e_disable_async_events(priv);
-       flush_scheduled_work();
        free_netdev(netdev);
 }