Skip to content

Commit

Permalink
RDMA/hns: Fixed wrong judgments in the goto branch
Browse files Browse the repository at this point in the history
[ Upstream commit bb74fe7 ]

When an error occurs, the qp_table must be cleared, regardless of whether
the SRQ feature is enabled.

Fixes: 5c1f167 ("RDMA/hns: Init SRQ table for hip08")
Link: https://lore.kernel.org/r/1611997090-48820-5-git-send-email-liweihang@huawei.com
Signed-off-by: Wenpeng Liang <liangwenpeng@huawei.com>
Signed-off-by: Weihang Li <liweihang@huawei.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Wenpeng Liang authored and gregkh committed Mar 4, 2021
1 parent c42d1e8 commit d0005c4
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/infiniband/hw/hns/hns_roce_main.c
Expand Up @@ -848,8 +848,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);
Expand Down

0 comments on commit d0005c4

Please sign in to comment.