[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20260205045743.2412516-1-kuba@kernel.org>
Date: Wed, 4 Feb 2026 20:57:43 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: arnd@...nel.org
Cc: Jakub Kicinski <kuba@...nel.org>,
jeff@...zik.org,
bhelgaas@...gle.com,
davem@...emloft.net,
tglx@...nel.org,
lukas@...ner.de,
linux-kernel@...r.kernel.org,
andrew+netdev@...n.ch,
giovanni.cabiddu@...el.com,
netdev@...r.kernel.org,
gallatin@...i.com,
arnd@...db.de,
brice@...i.com,
mingo@...nel.org,
pabeni@...hat.com,
edumazet@...gle.com
Subject: Re: [2/2,v3] myri10ge: avoid uninitialized variable use
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
Powered by blists - more mailing lists