]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - drivers/net/ethernet/mellanox/mlx4/en_netdev.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
[karo-tx-linux.git] / drivers / net / ethernet / mellanox / mlx4 / en_netdev.c
index 9018bb1b2e12142e048281a9d28ddf95e0023a61..c48ce3f366c378104c2b14da7376e3295093fcfb 100644 (file)
@@ -129,6 +129,9 @@ static enum mlx4_net_trans_rule_id mlx4_ip_proto_to_trans_rule_id(u8 ip_proto)
        }
 };
 
+/* Must not acquire state_lock, as its corresponding work_sync
+ * is done under it.
+ */
 static void mlx4_en_filter_work(struct work_struct *work)
 {
        struct mlx4_en_filter *filter = container_of(work,
@@ -2239,13 +2242,13 @@ void mlx4_en_destroy_netdev(struct net_device *dev)
        mutex_lock(&mdev->state_lock);
        mdev->pndev[priv->port] = NULL;
        mdev->upper[priv->port] = NULL;
-       mutex_unlock(&mdev->state_lock);
 
 #ifdef CONFIG_RFS_ACCEL
        mlx4_en_cleanup_filters(priv);
 #endif
 
        mlx4_en_free_resources(priv);
+       mutex_unlock(&mdev->state_lock);
 
        for (t = 0; t < MLX4_EN_NUM_TX_TYPES; t++) {
                kfree(priv->tx_ring[t]);