Hello Saeed Mahameed and Feras Daoud, I'm not exactly sure if I should blame commit c4d7eb57687f: "net/mxl5e: Add change profile method" fomr Mar 22, 2020 or commit 182570b26223 ("net/mlx5e: Gather common netdev init/cleanup functionality in one place") from Oct 2, 2018. drivers/net/ethernet/mellanox/mlx5/core/en_main.c:5658 mlx5e_netdev_change_profile() warn: 'priv->htb.qos_sq_stats' double freed drivers/net/ethernet/mellanox/mlx5/core/en_main.c:5658 mlx5e_netdev_change_profile() warn: 'priv->scratchpad.cpumask' double freed drivers/net/ethernet/mellanox/mlx5/core/en_main.c:5789 mlx5e_probe() warn: 'priv->htb.qos_sq_stats' double freed drivers/net/ethernet/mellanox/mlx5/core/en_main.c:5789 mlx5e_probe() warn: 'priv->scratchpad.cpumask' double freed drivers/net/ethernet/mellanox/mlx5/core/en_main.c:5802 mlx5e_remove() warn: 'priv->htb.qos_sq_stats' double freed drivers/net/ethernet/mellanox/mlx5/core/en_main.c:5802 mlx5e_remove() warn: 'priv->scratchpad.cpumask' double freed drivers/net/ethernet/mellanox/mlx5/core/en_rep.c:1317 mlx5e_vport_rep_unload() warn: 'priv->htb.qos_sq_stats' double freed drivers/net/ethernet/mellanox/mlx5/core/en_rep.c:1317 mlx5e_vport_rep_unload() warn: 'priv->scratchpad.cpumask' double freed drivers/net/ethernet/mellanox/mlx5/core/en_main.c 5639 int mlx5e_netdev_change_profile(struct mlx5e_priv *priv, 5640 const struct mlx5e_profile *new_profile, void *new_ppriv) 5641 { 5642 unsigned int new_max_nch = mlx5e_calc_max_nch(priv, new_profile); 5643 const struct mlx5e_profile *orig_profile = priv->profile; 5644 void *orig_ppriv = priv->ppriv; 5645 int err, rollback_err; 5646 5647 /* sanity */ 5648 if (new_max_nch != priv->max_nch) { 5649 netdev_warn(priv->netdev, 5650 "%s: Replacing profile with different max channles\n", 5651 __func__); 5652 return -EINVAL; 5653 } 5654 5655 /* cleanup old profile */ 5656 mlx5e_detach_netdev(priv); 5657 priv->profile->cleanup(priv); The problem is that mlx5i_pkey_cleanup() calls mlx5e_priv_cleanup(). 5658 mlx5e_priv_cleanup(priv); ^^^^^^^^^^^^^^^^^^^^^^^^ And then it gets called again here. 5659 5660 err = mlx5e_netdev_attach_profile(priv, new_profile, new_ppriv); 5661 if (err) { /* roll back to original profile */ 5662 netdev_warn(priv->netdev, "%s: new profile init failed, %d\n", 5663 __func__, err); 5664 goto rollback; 5665 } 5666 5667 return 0; 5668 5669 rollback: 5670 rollback_err = mlx5e_netdev_attach_profile(priv, orig_profile, orig_ppriv); 5671 if (rollback_err) { 5672 netdev_err(priv->netdev, 5673 "%s: failed to rollback to orig profile, %d\n", 5674 __func__, rollback_err); 5675 } 5676 return err; 5677 } regards, dan carpenter