Commit f78cf185 authored by Junxian Huang's avatar Junxian Huang
Browse files

RDMA/hns: Fix missing xa_destroy()

maillist inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/IBV0G0
CVE: NA

Reference: https://web.git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git/commit/?h=wip/leon-for-rc&id=eda0a2fdbc24c35cd8d61d9c9111cafd5f89b2dc



----------------------------------------------------------------------

Add xa_destroy() for xarray in driver.

Fixes: 5c1f167a ("RDMA/hns: Init SRQ table for hip08")
Fixes: 27e19f45 ("RDMA/hns: Convert cq_table to XArray")
Fixes: 736b5a70 ("RDMA/hns: Convert qp_table_tree to XArray")
Signed-off-by: default avatarJunxian Huang <huangjunxian6@hisilicon.com>
Link: https://patch.msgid.link/20250311084857.3803665-7-huangjunxian6@hisilicon.com


Signed-off-by: default avatarLeon Romanovsky <leon@kernel.org>
Signed-off-by: default avatarXinghai Cen <cenxinghai@h-partners.com>
parent ecbb99fa
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -175,8 +175,10 @@ void hns_roce_cleanup_bitmap(struct hns_roce_dev *hr_dev)
	if (hr_dev->caps.flags & HNS_ROCE_CAP_FLAG_XRC)
		ida_destroy(&hr_dev->xrcd_ida.ida);

	if (hr_dev->caps.flags & HNS_ROCE_CAP_FLAG_SRQ)
	if (hr_dev->caps.flags & HNS_ROCE_CAP_FLAG_SRQ) {
		ida_destroy(&hr_dev->srq_table.srq_ida.ida);
		xa_destroy(&hr_dev->srq_table.xa);
	}
	hns_roce_cleanup_qp_table(hr_dev);
	hns_roce_cleanup_cq_table(hr_dev);
	ida_destroy(&hr_dev->mr_table.mtpt_ida.ida);
+1 −0
Original line number Diff line number Diff line
@@ -616,5 +616,6 @@ void hns_roce_cleanup_cq_table(struct hns_roce_dev *hr_dev)

	for (i = 0; i < HNS_ROCE_CQ_BANK_NUM; i++)
		ida_destroy(&hr_dev->cq_table.bank[i].ida);
	xa_destroy(&hr_dev->cq_table.array);
	mutex_destroy(&hr_dev->cq_table.bank_mutex);
}
+1 −0
Original line number Diff line number Diff line
@@ -1781,6 +1781,7 @@ void hns_roce_cleanup_qp_table(struct hns_roce_dev *hr_dev)
	for (i = 0; i < HNS_ROCE_QP_BANK_NUM; i++)
		ida_destroy(&hr_dev->qp_table.bank[i].ida);
	xa_destroy(&hr_dev->qp_table.dip_xa);
	xa_destroy(&hr_dev->qp_table_xa);
	mutex_destroy(&hr_dev->qp_table.bank_mutex);
	mutex_destroy(&hr_dev->qp_table.scc_mutex);
}