Skip to content

Commit eda0a2f

Browse files
Junxian Huangrleon
authored andcommitted
RDMA/hns: Fix missing xa_destroy()
Add xa_destroy() for xarray in driver. Fixes: 5c1f167 ("RDMA/hns: Init SRQ table for hip08") Fixes: 27e19f4 ("RDMA/hns: Convert cq_table to XArray") Fixes: 736b5a7 ("RDMA/hns: Convert qp_table_tree to XArray") Signed-off-by: Junxian Huang <huangjunxian6@hisilicon.com> Link: https://patch.msgid.link/20250311084857.3803665-7-huangjunxian6@hisilicon.com Signed-off-by: Leon Romanovsky <leon@kernel.org>
1 parent 444907d commit eda0a2f

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

drivers/infiniband/hw/hns/hns_roce_alloc.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,10 @@ void hns_roce_cleanup_bitmap(struct hns_roce_dev *hr_dev)
175175
if (hr_dev->caps.flags & HNS_ROCE_CAP_FLAG_XRC)
176176
ida_destroy(&hr_dev->xrcd_ida.ida);
177177

178-
if (hr_dev->caps.flags & HNS_ROCE_CAP_FLAG_SRQ)
178+
if (hr_dev->caps.flags & HNS_ROCE_CAP_FLAG_SRQ) {
179179
ida_destroy(&hr_dev->srq_table.srq_ida.ida);
180+
xa_destroy(&hr_dev->srq_table.xa);
181+
}
180182
hns_roce_cleanup_qp_table(hr_dev);
181183
hns_roce_cleanup_cq_table(hr_dev);
182184
ida_destroy(&hr_dev->mr_table.mtpt_ida.ida);

drivers/infiniband/hw/hns/hns_roce_cq.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -537,5 +537,6 @@ void hns_roce_cleanup_cq_table(struct hns_roce_dev *hr_dev)
537537

538538
for (i = 0; i < HNS_ROCE_CQ_BANK_NUM; i++)
539539
ida_destroy(&hr_dev->cq_table.bank[i].ida);
540+
xa_destroy(&hr_dev->cq_table.array);
540541
mutex_destroy(&hr_dev->cq_table.bank_mutex);
541542
}

drivers/infiniband/hw/hns/hns_roce_qp.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1603,6 +1603,7 @@ void hns_roce_cleanup_qp_table(struct hns_roce_dev *hr_dev)
16031603
for (i = 0; i < HNS_ROCE_QP_BANK_NUM; i++)
16041604
ida_destroy(&hr_dev->qp_table.bank[i].ida);
16051605
xa_destroy(&hr_dev->qp_table.dip_xa);
1606+
xa_destroy(&hr_dev->qp_table_xa);
16061607
mutex_destroy(&hr_dev->qp_table.bank_mutex);
16071608
mutex_destroy(&hr_dev->qp_table.scc_mutex);
16081609
}

0 commit comments

Comments
 (0)