Hi,
On 14/11/2025 7:49 PM, Stephen Hemminger wrote:
Gcc-16 detects use of uninitialized variable.
./drivers/net/mlx5/linux/mlx5_ethdev_os.c: In function ‘mlx5_link_update’:
../drivers/net/mlx5/linux/mlx5_ethdev_os.c:539:15: warning: ‘*(long unsigned int *)((char
*)&dev_link + offsetof(struct rte_eth_link, <U38c0>))’ may be used
uninitialized [-Wmaybe-uninitialized]
539 | ret = !!memcmp(&dev->data->dev_link, &dev_link,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
540 | sizeof(struct rte_eth_link));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../drivers/net/mlx5/linux/mlx5_ethdev_os.c:515:29: note: ‘*(long unsigned int *)((char
*)&dev_link + offsetof(struct rte_eth_link, <U38c0>))’ was declared here
515 | struct rte_eth_link dev_link;
|
If the retry loop exits the code would do memcmp against uninitialized
stack value. Resolve by initializing to zero.
Bugzilla ID: 1823
Fixes: 1256805dd54d ("net/mlx5: move Linux-specific functions")
Fixes: cfee94752b8f ("net/mlx5: fix link status to use wait to complete")
Cc: [email protected]
Signed-off-by: Stephen Hemminger <[email protected]>
Acked-by: Raslan Darawsheh <[email protected]>
Patch applied to next-net-mlx,
Kindest regards
Raslan Darawsheh