From: Jakub Kicinski <kuba@kernel.org>
To: arnd@kernel.org
Cc: Jakub Kicinski <kuba@kernel.org>,
jeff@garzik.org, bhelgaas@google.com, davem@davemloft.net,
tglx@kernel.org, lukas@wunner.de, linux-kernel@vger.kernel.org,
andrew+netdev@lunn.ch, giovanni.cabiddu@intel.com,
netdev@vger.kernel.org, gallatin@myri.com, arnd@arndb.de,
brice@myri.com, mingo@kernel.org, pabeni@redhat.com,
edumazet@google.com
Subject: Re: [2/2,v3] myri10ge: avoid uninitialized variable use
Date: Wed, 4 Feb 2026 20:57:43 -0800 [thread overview]
Message-ID: <20260205045743.2412516-1-kuba@kernel.org> (raw)
In-Reply-To: <20260203230501.832872-2-arnd@kernel.org>
This is an AI-generated review of your patch. The human sending this
email has considered the AI review valid, or at least plausible.
For local reproduction steps see https://netdev-ai.bots.linux.dev/ai-local.html
---
myri10ge: avoid uninitialized variable use
This patch fixes uninitialized variable warnings found by gcc-10 on s390
by initializing cmd.data0, cmd.data1, and cmd.data2 before calls to
myri10ge_send_cmd() across multiple functions.
> diff --git a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c b/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
> --- a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
> +++ b/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
[ ... ]
> @@ -2238,6 +2250,8 @@ static int myri10ge_get_txrx(struct myri10ge_priv *mgp, int slice)
> status = 0;
> if (slice == 0 || (mgp->dev->real_num_tx_queues > 1)) {
> cmd.data0 = slice;
> + cmd.data1 = 0;
> + cmd.data2 = 0;
> status = myri10ge_send_cmd(mgp, MXGEFW_CMD_GET_SEND_OFFSET,
> &cmd, 0);
> ss->tx.lanai = (struct mcp_kreq_ether_send __iomem *)
> (mgp->sram + cmd.data0);
> }
> cmd.data0 = slice;
> status |= myri10ge_send_cmd(mgp, MXGEFW_CMD_GET_SMALL_RX_OFFSET,
> &cmd, 0);
The initialization of cmd.data1 and cmd.data2 is inside the conditional
block. When slice > 0 and real_num_tx_queues <= 1, does the subsequent
myri10ge_send_cmd() call for MXGEFW_CMD_GET_SMALL_RX_OFFSET use
uninitialized data1/data2 values?
Simon Horman pointed this out in his review of v2:
https://lore.kernel.org/all/20250622162715.GA297140@horms.kernel.org/
He provided a diff showing that the second cmd.data0 = slice assignment
also needs cmd.data1 and cmd.data2 initialization. This feedback does
not appear to have been addressed in v3.
--
pw-bot: cr
next prev parent reply other threads:[~2026-02-05 5:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-03 23:04 [PATCH 1/2] myri10ge: avoid passing uninitialized data to inline asm Arnd Bergmann
2026-02-03 23:04 ` [PATCH 2/2] [v3] myri10ge: avoid uninitialized variable use Arnd Bergmann
2026-02-05 4:57 ` Jakub Kicinski [this message]
2026-02-05 16:30 ` [2/2,v3] " Arnd Bergmann
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=20260205045743.2412516-1-kuba@kernel.org \
--to=kuba@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=arnd@arndb.de \
--cc=arnd@kernel.org \
--cc=bhelgaas@google.com \
--cc=brice@myri.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gallatin@myri.com \
--cc=giovanni.cabiddu@intel.com \
--cc=jeff@garzik.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lukas@wunner.de \
--cc=mingo@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=tglx@kernel.org \
/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