Subject: Re: [PATCH net-next v3 5/6] net: ngbe: add sriov function support

From: Simon Horman <[email-masked]>
Date: Wed, 15 May 2024 16:22:20 +0100

On Wed, May 15, 2024 at 05:50:08PM +0800, Mengyuan Lou wrote:
> Add sriov_configure for driver ops.
> Add mailbox handler wx_msg_task for ngbe in
> the interrupt handler.
> Add the notification flow when the vfs exist.
> 
> Signed-off-by: Mengyuan Lou <[email-masked]>

...

> +void wx_ping_all_vfs_with_link_status(struct wx *wx, bool link_up)
> +{
> +	u32 msgbuf[2] = {0, 0};
> +	u16 i;
> +
> +	if (!wx->num_vfs)
> +		return;
> +	msgbuf[0] = WX_PF_NOFITY_VF_LINK_STATUS | WX_PF_CONTROL_MSG;
> +	if (link_up)
> +		msgbuf[1] = (wx->speed << 1) | link_up;
> +	if (wx->vfinfo[i].clear_to_send)

Hi Mengyuan Lou,

i appears to be used uninitialised here.

Flagged by clang-18 W=1, and Smatch.

> +		msgbuf[0] |= WX_VT_MSGTYPE_CTS;
> +	if (wx->notify_not_runnning)
> +		msgbuf[1] |= WX_PF_NOFITY_VF_NET_NOT_RUNNING;
> +	for (i = 0 ; i < wx->num_vfs; i++)
> +		wx_write_mbx_pf(wx, msgbuf, 2, i);
> +}
> +EXPORT_SYMBOL(wx_ping_all_vfs_with_link_status);

...

-- 
pw-bot: changes-requested