All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] RDMA/rdmavt: fix error code in rvt_create_qp()
@ 2021-10-13  8:06 Dan Carpenter
  2021-10-13 14:16 ` Dennis Dalessandro
  2021-10-13 18:19 ` Jason Gunthorpe
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2021-10-13  8:06 UTC (permalink / raw)
  To: Dennis Dalessandro, Leon Romanovsky
  Cc: Mike Marciniszyn, Doug Ledford, Jason Gunthorpe, Gal Pressman,
	linux-rdma, kernel-janitors

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: 514aee660df4 ("RDMA: Globally allocate and release QP memory")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/infiniband/sw/rdmavt/qp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/sw/rdmavt/qp.c b/drivers/infiniband/sw/rdmavt/qp.c
index 49bdd78ac664..3305f2744bfa 100644
--- a/drivers/infiniband/sw/rdmavt/qp.c
+++ b/drivers/infiniband/sw/rdmavt/qp.c
@@ -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;
 	}
 
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-10-13 18:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-13  8:06 [PATCH] RDMA/rdmavt: fix error code in rvt_create_qp() Dan Carpenter
2021-10-13 14:16 ` Dennis Dalessandro
2021-10-13 18:19 ` Jason Gunthorpe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.