All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] RDMA: Fix an uninitialized variable
@ 2018-08-03 19:24 Dan Carpenter
  2018-08-03 19:43 ` Jason Gunthorpe
  2018-08-03 19:56 ` Bart Van Assche
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2018-08-03 19:24 UTC (permalink / raw)
  To: kernel-janitors

A couple of the callers assume that ib_post_send() initializes
*bad_send_wr.  It doesn't look like we can rely on the ->post_send()
function to initialize it.  For example in the i40iw_post_recv()
function and there are some error paths there which don't set it.

Here are the static checker warnings for reference:

net/sunrpc/xprtrdma/verbs.c:1564 rpcrdma_post_recvs() error: uninitialized symbol 'bad_wr'.
net/sunrpc/xprtrdma/svc_rdma_rw.c:350 svc_rdma_post_chunk_ctxt() error: uninitialized symbol 'bad_wr'.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index 8caee90e6dee..0ebacbe5019e 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -3389,6 +3389,8 @@ static inline int ib_post_send(struct ib_qp *qp,
 {
 	const struct ib_send_wr *dummy;
 
+	if (bad_send_wr)
+		*bad_send_wr = NULL;
 	return qp->device->post_send(qp, send_wr, bad_send_wr ? : &dummy);
 }
 

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

end of thread, other threads:[~2018-08-03 19:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-03 19:24 [PATCH] RDMA: Fix an uninitialized variable Dan Carpenter
2018-08-03 19:43 ` Jason Gunthorpe
2018-08-03 19:56 ` Bart Van Assche

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.