aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
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 /drivers
parentRDMA/hns: Add 50GE type of hnae3 device match (diff)
downloadlinux-dev-dedf63506a8e55235edf902fa7455cd2974e462d.tar.xz
linux-dev-dedf63506a8e55235edf902fa7455cd2974e462d.zip
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>
Diffstat (limited to 'drivers')
-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)