Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
From: Cheng Xu <chengyou@linux.alibaba.com>
To: Ruoyu Wang <ruoyuw560@gmail.com>,
	Jason Gunthorpe <jgg@nvidia.com>,
	Leon Romanovsky <leonro@nvidia.com>
Cc: Kai Shen <kaishen@linux.alibaba.com>, linux-rdma@vger.kernel.org
Subject: Re: [PATCH v2 1/2] RDMA/erdma: initialize ret for empty receive WR lists
Date: Mon, 22 Jun 2026 10:48:59 +0800	[thread overview]
Message-ID: <2ab39704-bc44-6898-46ea-241496ab594d@linux.alibaba.com> (raw)
In-Reply-To: <20260618041752.481193-1-ruoyuw560@gmail.com>

Reviewed-by: Cheng Xu <chengyou@linux.alibaba.com>

On 6/18/26 12:17 PM, Ruoyu Wang wrote:
> 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);
>  

  parent reply	other threads:[~2026-06-22  2:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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-19 17:09   ` [EXTERNAL] " Long Li
2026-06-22  2:48 ` Cheng Xu [this message]
2026-07-02 17:17 ` [PATCH v2 1/2] RDMA/erdma: initialize ret for empty receive " Jason Gunthorpe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2ab39704-bc44-6898-46ea-241496ab594d@linux.alibaba.com \
    --to=chengyou@linux.alibaba.com \
    --cc=jgg@nvidia.com \
    --cc=kaishen@linux.alibaba.com \
    --cc=leonro@nvidia.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=ruoyuw560@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox