Commit 020fb3be authored by Wei Yongjun's avatar Wei Yongjun Committed by Doug Ledford

RDMA/hns: Fix error return code in hns_roce_v1_rsv_lp_qp()

Fix to return error code -ENOMEM from the rdma_zalloc_drv_obj() error
handling case instead of 0, as done elsewhere in this function.

Fixes: e8ac9389 ("RDMA: Fix allocation failure on pointer pd")
Fixes: 21a428a0 ("RDMA: Handle PD allocations by IB/core")
Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: default avatarLeon Romanovsky <leonro@mellanox.com>
Link: https://lore.kernel.org/r/20190801012725.150493-1-weiyongjun1@huawei.comSigned-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent 23eaf3b5
......@@ -750,8 +750,10 @@ static int hns_roce_v1_rsv_lp_qp(struct hns_roce_dev *hr_dev)
atomic_set(&free_mr->mr_free_cq->ib_cq.usecnt, 0);
pd = rdma_zalloc_drv_obj(ibdev, ib_pd);
if (!pd)
if (!pd) {
ret = -ENOMEM;
goto alloc_mem_failed;
}
pd->device = ibdev;
ret = hns_roce_alloc_pd(pd, NULL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment