Linux-HyperV List
 help / color / mirror / Atom feed
* [PATCH v2 1/2] RDMA/erdma: initialize ret for empty receive WR lists
@ 2026-06-18  4:17 Ruoyu Wang
  2026-06-18  4:17 ` [PATCH v2 2/2] RDMA/mana_ib: initialize err for empty send " Ruoyu Wang
  2026-06-18  4:30 ` [PATCH v2 1/2] RDMA/erdma: initialize ret for empty receive " sashiko-bot
  0 siblings, 2 replies; 3+ messages in thread
From: Ruoyu Wang @ 2026-06-18  4:17 UTC (permalink / raw)
  To: Jason Gunthorpe, Leon Romanovsky
  Cc: Cheng Xu, Kai Shen, Long Li, Konstantin Taranov, linux-rdma,
	linux-hyperv, linux-kernel, Ruoyu Wang

erdma_post_recv() returns ret after walking the receive work request list.
If the caller passes an empty list, the loop is skipped and ret is not
assigned.

Initialize ret to 0 so an empty receive work request list returns success
instead of stack data.

Fixes: 155055771704 ("RDMA/erdma: Add verbs implementation")
Signed-off-by: Ruoyu Wang <ruoyuw560@gmail.com>
---
v2:
- Split the erdma and mana_ib changes into separate patches.
- Add a driver-specific Fixes tag.

 drivers/infiniband/hw/erdma/erdma_qp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/erdma/erdma_qp.c b/drivers/infiniband/hw/erdma/erdma_qp.c
index 25f6c49aec779..e002343832f74 100644
--- a/drivers/infiniband/hw/erdma/erdma_qp.c
+++ b/drivers/infiniband/hw/erdma/erdma_qp.c
@@ -734,7 +734,7 @@ int erdma_post_recv(struct ib_qp *ibqp, const struct ib_recv_wr *recv_wr,
 	const struct ib_recv_wr *wr = recv_wr;
 	struct erdma_qp *qp = to_eqp(ibqp);
 	unsigned long flags;
-	int ret;
+	int ret = 0;
 
 	spin_lock_irqsave(&qp->lock, flags);
 
-- 
2.51.0

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

end of thread, other threads:[~2026-06-18  4:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-18  4:17 [PATCH v2 1/2] RDMA/erdma: initialize ret for empty receive WR lists Ruoyu Wang
2026-06-18  4:17 ` [PATCH v2 2/2] RDMA/mana_ib: initialize err for empty send " Ruoyu Wang
2026-06-18  4:30 ` [PATCH v2 1/2] RDMA/erdma: initialize ret for empty receive " sashiko-bot

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