public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] RDMA/qedr: Missing error code in qedr_init_user_queue()
@ 2017-08-25  8:18 Dan Carpenter
  2017-08-29  0:36 ` Doug Ledford
  2017-08-29  7:02 ` Kalderon, Michal
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2017-08-25  8:18 UTC (permalink / raw)
  To: Ram Amrani, Kalderon, Michal
  Cc: Ariel Elior, Doug Ledford, Sean Hefty, Hal Rosenstock,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA

We should return -ENOMEM if the kzalloc() fails.  We currently return
success.

Fixes: 69ad0e7fe845 ("RDMA/qedr: Add support for iWARP in user space")
Signed-off-by: Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>

diff --git a/drivers/infiniband/hw/qedr/verbs.c b/drivers/infiniband/hw/qedr/verbs.c
index 4e14a558734b..bce4f79370e6 100644
--- a/drivers/infiniband/hw/qedr/verbs.c
+++ b/drivers/infiniband/hw/qedr/verbs.c
@@ -821,8 +821,10 @@ static inline int qedr_init_user_queue(struct ib_ucontext *ib_ctx,
 				   FW_PAGE_SHIFT);
 	} else {
 		q->pbl_tbl = kzalloc(sizeof(*q->pbl_tbl), GFP_KERNEL);
-		if (!q->pbl_tbl)
+		if (!q->pbl_tbl) {
+			rc = -ENOMEM;
 			goto err0;
+		}
 	}
 
 	return 0;
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2017-08-29  7:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-25  8:18 [PATCH] RDMA/qedr: Missing error code in qedr_init_user_queue() Dan Carpenter
2017-08-29  0:36 ` Doug Ledford
2017-08-29  7:02 ` Kalderon, Michal

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