DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>,
	stable@dpdk.org, Renyong Wan <wanry@yunsilicon.com>,
	Na Na <nana@yunsilicon.com>, Rong Qian <qianr@yunsilicon.com>,
	Xiaoxiong Zhang <zhangxx@yunsilicon.com>,
	Dongwei Xu <xudw@yunsilicon.com>
Subject: [PATCH] net/xsc: fix uninitialized return value in QP modify
Date: Mon,  9 Nov 2026 18:18:00 -0800	[thread overview]
Message-ID: <20261110021801.766315-1-stephen@networkplumber.org> (raw)

If xsc_vfio_modify_qp_status() is called with num <= 0 the loop
is skipped and an uninitialized value is returned.
All current callers pass num = 1, but gcc 15 at -O1 cannot see
that through the dev_ops indirection and reports:

  xsc_vfio.c:491:16: error: 'ret' may be used uninitialized

Initialize ret to 0.

Bugzilla ID: 2099
Fixes: 31e84e37c0b9 ("net/xsc: support VFIO")
Cc: stable@dpdk.org

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/xsc/xsc_vfio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/xsc/xsc_vfio.c b/drivers/net/xsc/xsc_vfio.c
index 0a1e507f7d..bae891cfba 100644
--- a/drivers/net/xsc/xsc_vfio.c
+++ b/drivers/net/xsc/xsc_vfio.c
@@ -449,7 +449,7 @@ xsc_vfio_link_get(struct xsc_dev *xdev, struct rte_eth_link *link)
 static int
 xsc_vfio_modify_qp_status(struct xsc_dev *xdev, uint32_t qpn, int num, int opcode)
 {
-	int i, ret;
+	int i, ret = 0;
 	int in_len, out_len, cmd_len;
 	struct xsc_cmd_modify_qp_mbox_in *in;
 	struct xsc_cmd_modify_qp_mbox_out *out;
-- 
2.53.0


             reply	other threads:[~2026-11-10  2:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-10  2:18 Stephen Hemminger [this message]
2026-11-10  7:11 ` [PATCH] net/xsc: fix uninitialized return value in QP modify Renyong Wan

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=20261110021801.766315-1-stephen@networkplumber.org \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=nana@yunsilicon.com \
    --cc=qianr@yunsilicon.com \
    --cc=stable@dpdk.org \
    --cc=wanry@yunsilicon.com \
    --cc=xudw@yunsilicon.com \
    --cc=zhangxx@yunsilicon.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