public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH]  RDMA/bnxt_re: Fix an error code in bnxt_qplib_create_srq()
@ 2018-01-30 20:40 Dan Carpenter
  2018-01-31  5:48 ` Devesh Sharma
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2018-01-30 20:40 UTC (permalink / raw)
  To: Selvin Xavier, Devesh Sharma
  Cc: Somnath Kotur, Sriharsha Basavapatna, Doug Ledford,
	Jason Gunthorpe, linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA

We should return -ENOMEM if the allocation fails.  (The current code
returns succees).

Fixes: 37cb11acf1f7 ("RDMA/bnxt_re: Add SRQ support for Broadcom adapters")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/infiniband/hw/bnxt_re/qplib_fp.c b/drivers/infiniband/hw/bnxt_re/qplib_fp.c
index 8b5f11ac0e42..1b0e94697fe3 100644
--- a/drivers/infiniband/hw/bnxt_re/qplib_fp.c
+++ b/drivers/infiniband/hw/bnxt_re/qplib_fp.c
@@ -557,8 +557,10 @@ int bnxt_qplib_create_srq(struct bnxt_qplib_res *res,
 
 	srq->swq = kcalloc(srq->hwq.max_elements, sizeof(*srq->swq),
 			   GFP_KERNEL);
-	if (!srq->swq)
+	if (!srq->swq) {
+		rc = -ENOMEM;
 		goto fail;
+	}
 
 	RCFW_CMD_PREP(req, CREATE_SRQ, cmd_flags);
 

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

end of thread, other threads:[~2018-01-31 16:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-30 20:40 [PATCH] RDMA/bnxt_re: Fix an error code in bnxt_qplib_create_srq() Dan Carpenter
2018-01-31  5:48 ` Devesh Sharma
2018-01-31 16:19   ` Doug Ledford

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox