Message ID | 2a43192bf2649c1076b6a3b92ad6fd7d967d4498.1649139915.git.leonro@nvidia.com (mailing list archive) |
---|---|
State | Changes Requested |
Headers | show |
Series | Handle FW failures to destroy QP/RQ objects | expand |
diff --git a/drivers/infiniband/hw/mlx5/qpc.c b/drivers/infiniband/hw/mlx5/qpc.c index 542e4c63a8de..d9ce73a2fbeb 100644 --- a/drivers/infiniband/hw/mlx5/qpc.c +++ b/drivers/infiniband/hw/mlx5/qpc.c @@ -178,6 +178,9 @@ static void destroy_resource_common(struct mlx5_ib_dev *dev, struct mlx5_qp_table *table = &dev->qp_table; unsigned long flags; + if (refcount_read(&qp->common.refcount) == 0) + return; + spin_lock_irqsave(&table->lock, flags); radix_tree_delete(&table->tree, qp->qpn | (qp->common.res << MLX5_USER_INDEX_LEN));