diff options
author | Patrisious Haddad <phaddad@nvidia.com> | 2023-06-05 13:14:04 +0300 |
---|---|---|
committer | Leon Romanovsky <leon@kernel.org> | 2023-06-11 11:21:23 +0300 |
commit | c023b61ac8285dc6b2b2f275bf9d97cfd36b56fb (patch) | |
tree | c402040764213a4ce0b64f853941211a16a458cb /drivers/net/ethernet/mellanox | |
parent | 7ad697cdd31b9d5e59e25b035bad4cdd8e76aca1 (diff) | |
download | linux-stable-c023b61ac8285dc6b2b2f275bf9d97cfd36b56fb.tar.gz linux-stable-c023b61ac8285dc6b2b2f275bf9d97cfd36b56fb.tar.bz2 linux-stable-c023b61ac8285dc6b2b2f275bf9d97cfd36b56fb.zip |
net/mlx5: Nullify qp->dbg pointer post destruction
Nullifying qp->dbg is a preparation for the next patches
from the series in which mlx5_core_destroy_qp() could actually fail,
and then it can be called again which causes a kernel crash, since
qp->dbg was not nullified in previous call.
Signed-off-by: Patrisious Haddad <phaddad@nvidia.com>
Link: https://lore.kernel.org/r/1677e52bb642fd8d6062d73a5aa69083c0283dc9.1685953497.git.leon@kernel.org
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Diffstat (limited to 'drivers/net/ethernet/mellanox')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/debugfs.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/debugfs.c b/drivers/net/ethernet/mellanox/mlx5/core/debugfs.c index bb95b40d25eb..b08b5695ee45 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/debugfs.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/debugfs.c @@ -513,11 +513,11 @@ EXPORT_SYMBOL(mlx5_debug_qp_add); void mlx5_debug_qp_remove(struct mlx5_core_dev *dev, struct mlx5_core_qp *qp) { - if (!mlx5_debugfs_root) + if (!mlx5_debugfs_root || !qp->dbg) return; - if (qp->dbg) - rem_res_tree(qp->dbg); + rem_res_tree(qp->dbg); + qp->dbg = NULL; } EXPORT_SYMBOL(mlx5_debug_qp_remove); |