Re: [2/2,v3] myri10ge: avoid uninitialized variable use
From: Jakub Kicinski
Date: Thu Feb 05 2026 - 00:08:25 EST
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@xxxxxxxxxxxxxxxx/
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