summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLijun Ou <oulijun@huawei.com>2018-07-25 15:29:36 +0800
committerJason Gunthorpe <jgg@mellanox.com>2018-07-26 16:51:12 -0600
commitdedf63506a8e55235edf902fa7455cd2974e462d (patch)
treeed0d5a287dd008286bdf6eded40a45422823283d
parentaaa31567799dbce55a1b780355dabf83556018d0 (diff)
downloadlinux-dedf63506a8e55235edf902fa7455cd2974e462d.tar.bz2
RDMA/hns: Return correct error code from hns_roce_v1_rsv_lp_qp()
When create loop qp fail, it will return the correct result when modify_qp() fails. Signed-off-by: Lijun Ou <oulijun@huawei.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
-rw-r--r--drivers/infiniband/hw/hns/hns_roce_hw_v1.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
index 783d28dd3ca4..ae6b642ec073 100644
--- a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
+++ b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
@@ -785,6 +785,7 @@ static int hns_roce_v1_rsv_lp_qp(struct hns_roce_dev *hr_dev)
free_mr->mr_free_qp[i] = hns_roce_v1_create_lp_qp(hr_dev, pd);
if (!free_mr->mr_free_qp[i]) {
dev_err(dev, "Create loop qp failed!\n");
+ ret = -ENOMEM;
goto create_lp_qp_failed;
}
hr_qp = free_mr->mr_free_qp[i];
@@ -854,7 +855,7 @@ alloc_pd_failed:
if (hns_roce_ib_destroy_cq(cq))
dev_err(dev, "Destroy cq for create_lp_qp failed!\n");
- return -EINVAL;
+ return ret;
}
static void hns_roce_v1_release_lp_qp(struct hns_roce_dev *hr_dev)