Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EA100282F29; Mon, 17 Aug 2026 15:01:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786978879; cv=none; b=AHUXfa2I9YsYEQQJ+40NKsSWkh1KBF3J7PYGPgfsJRDQaf/ODy8byRojt4EoK0Pwq2IFokAaPfWgkRuqYFyxzwHvSFIb93rFsahwZ2sg8T+cEbQDS4xD27Z/Zb7hZiXnLG0UJ3j2pQddOqGkJc+pNuHNNyiX0gpk0S2HoXbRpmA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786978879; c=relaxed/simple; bh=VnNFugAtdsKtkeb7pSejBnIFPOwsqgP1fNXN4KIO5VY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Dv0U+7zFzOGabRUWG0h95ZkYs/dw2TJbIkUl40oSBwR5A4nfM2Re9VZMRyLSXNV1Srs3ps+OrCgzDU7pxOgqiY+QSDoeqDSQR6Vt/RR75w+fy0v+LtY44PBME13aIDZbig07KMp8YBAKjiC+5147qlVwbaDT65sHeUPNbz5ScIU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=llMtKzP/; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="llMtKzP/" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 304BA1F000E9; Mon, 17 Aug 2026 15:01:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1786978877; bh=JnFSbHNs23stLVvTocXhXyGAEznKEdJ6yUiDq2iDSNA=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=llMtKzP/lcLsbFh6pjkbB6jBimCAKABPWz2U4TAGggxfRa8YDTkKGz82XPLz0l4LJ IF7pvbd9FIxwc065vdI2k0YdoQd/QHxkAcf6+6321RySUz/owkNVNh3qWNl8s8cNvR KV/1Q8cOK9/yXJESExD9FGh9YWoQwZpjZCHSL5XI= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Ruoyu Wang , Cheng Xu , Jason Gunthorpe , Sasha Levin Subject: [PATCH 6.1 032/609] RDMA/erdma: initialize ret for empty receive WR lists Date: Mon, 17 Aug 2026 15:25:28 +0200 Message-ID: <20260817132544.336496451@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260817132543.039278408@linuxfoundation.org> References: <20260817132543.039278408@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Ruoyu Wang [ Upstream commit 2815a277c53e9a84784d6410cd55a9da5b33068d ] 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") Link: https://patch.msgid.link/r/20260618041752.481193-1-ruoyuw560@gmail.com Signed-off-by: Ruoyu Wang Reviewed-by: Cheng Xu Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin --- 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 e3b0baa703e681..74cb47ab827e14 100644 --- a/drivers/infiniband/hw/erdma/erdma_qp.c +++ b/drivers/infiniband/hw/erdma/erdma_qp.c @@ -537,7 +537,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.53.0