RDMA/rdmavt: Fix error code in rvt_create_qp()
Return negative -ENOMEM instead of positive ENOMEM. Returning a postive
value will cause an Oops because it becomes an ERR_PTR() in the
create_qp() function.
Fixes: 514aee660d
("RDMA: Globally allocate and release QP memory")
Link: https://lore.kernel.org/r/20211013080645.GD6010@kili
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Dennis Dalessandro <dennis.dalessandro@cornelisnetworks.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
This commit is contained in:
parent
13bac86195
commit
663991f328
|
@ -1223,7 +1223,7 @@ int rvt_create_qp(struct ib_qp *ibqp, struct ib_qp_init_attr *init_attr,
|
|||
spin_lock(&rdi->n_qps_lock);
|
||||
if (rdi->n_qps_allocated == rdi->dparms.props.max_qp) {
|
||||
spin_unlock(&rdi->n_qps_lock);
|
||||
ret = ENOMEM;
|
||||
ret = -ENOMEM;
|
||||
goto bail_ip;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue