Commit fae6c678 authored by Chengchang Tang's avatar Chengchang Tang
Browse files

RDMA/hns: Fix accessing invalid dip_ctx during destroying QP

driver inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/IB7ASV



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

If it fails to modify QP to RTR, dip_ctx will not be attached. And
during detroying QP, the invalid dip_ctx pointer will be accessed.

Fixes: 5da61758 ("RDMA/hns: Fix different dgids mapping to the same dip_idx")
Signed-off-by: default avatarChengchang Tang <tangchengchang@huawei.com>
Signed-off-by: default avatarXinghai Cen <cenxinghai@h-partners.com>
parent 5d0b95af
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -6039,6 +6039,9 @@ static void put_dip_ctx_idx(struct hns_roce_dev *hr_dev,
{
	struct hns_roce_dip *hr_dip = hr_qp->dip;

	if (!hr_dip)
		return;

	xa_lock(&hr_dev->qp_table.dip_xa);

	hr_dip->qp_cnt--;