From: Shunfeng Yang yangshunfeng2@huawei.com
mainline inclusion from mainline-v5.12 commit bb74fe7e81c8 category: bugfix bugzilla: NA CVE: NA
When an error occurs, the qp_table must be cleared, regardless of whether the SRQ feature is enabled.
Signed-off-by: Shunfeng Yang yangshunfeng2@huawei.com Signed-off-by: Yangyang Li liyangyang20@huawei.com Reviewed-by: chunzhi hu huchunzhi@huawei.com Signed-off-by: Yang Yingliang yangyingliang@huawei.com --- drivers/infiniband/hw/hns/hns_roce_main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/infiniband/hw/hns/hns_roce_main.c b/drivers/infiniband/hw/hns/hns_roce_main.c index a604e6d931544..f3112683b9b24 100644 --- a/drivers/infiniband/hw/hns/hns_roce_main.c +++ b/drivers/infiniband/hw/hns/hns_roce_main.c @@ -1316,8 +1316,7 @@ static int hns_roce_setup_hca(struct hns_roce_dev *hr_dev) return 0;
err_qp_table_free: - if (hr_dev->caps.flags & HNS_ROCE_CAP_FLAG_SRQ) - hns_roce_cleanup_qp_table(hr_dev); + hns_roce_cleanup_qp_table(hr_dev);
err_cq_table_free: hns_roce_cleanup_cq_table(hr_dev);