Skip to content

Commit

Permalink
librdmacm: Don't overwrite errno returned from libibverbs
Browse files Browse the repository at this point in the history
[ Upstream commit 11bf280 ]

Some functions reports fixed ENOMEM when getting any failure, so
it's hard for user to know which actual error happens on them.

Fixes: 663098b ("Rename librdmacm")
Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Nicolas Morey-Chaisemartin <nmoreychaisemartin@suse.com>
  • Loading branch information
yangx-jy authored and nmorey committed Jan 22, 2021
1 parent 7f64687 commit e7ec169
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions librdmacm/cma.c
Expand Up @@ -473,7 +473,7 @@ static int ucma_get_device(struct cma_id_private *id_priv, __be64 guid)
cma_dev->pd = ibv_alloc_pd(cma_dev->verbs);
if (!cma_dev->pd) {
cma_dev->refcnt--;
ret = ERR(ENOMEM);
ret = -1;
goto out;
}
}
Expand Down Expand Up @@ -1308,7 +1308,7 @@ static int ucma_create_cqs(struct rdma_cm_id *id, uint32_t send_size, uint32_t r
return 0;
err:
ucma_destroy_cqs(id);
return ERR(ENOMEM);
return -1;
}

int rdma_create_srq_ex(struct rdma_cm_id *id, struct ibv_srq_init_attr_ex *attr)
Expand Down Expand Up @@ -1425,7 +1425,7 @@ int rdma_create_qp_ex(struct rdma_cm_id *id,
attr->srq = id->srq;
qp = ibv_create_qp_ex(id->verbs, attr);
if (!qp) {
ret = ERR(ENOMEM);
ret = -1;
goto err1;
}

Expand Down

0 comments on commit e7ec169

Please sign in to comment.