Skip to content

Commit 0572ecc

Browse files
Chengchang Tangrleon
authored andcommitted
RDMA/hns: Fix accessing invalid dip_ctx during destroying QP
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: faa6244 ("RDMA/hns: Fix different dgids mapping to the same dip_idx") Signed-off-by: Chengchang Tang <tangchengchang@huawei.com> Signed-off-by: Junxian Huang <huangjunxian6@hisilicon.com> Link: https://patch.msgid.link/20241220055249.146943-3-huangjunxian6@hisilicon.com Signed-off-by: Leon Romanovsky <leon@kernel.org>
1 parent 8673a6c commit 0572ecc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/infiniband/hw/hns/hns_roce_hw_v2.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5619,6 +5619,9 @@ static void put_dip_ctx_idx(struct hns_roce_dev *hr_dev,
56195619
{
56205620
struct hns_roce_dip *hr_dip = hr_qp->dip;
56215621

5622+
if (!hr_dip)
5623+
return;
5624+
56225625
xa_lock(&hr_dev->qp_table.dip_xa);
56235626

56245627
hr_dip->qp_cnt--;

0 commit comments

Comments
 (0)