From: Yunjian Wang <wangyunj...@huawei.com> The 'comps' struct field in 'moder' is not being initialized in mlx5e_get_def_rx_moderation(). So initialize 'moder' to zero to avoid the issue.
Addresses-Coverity: ("Uninitialized scalar variable") Fixes: 398c2b05bbee ("linux/dim: Add completions count to dim_sample") Signed-off-by: Yunjian Wang <wangyunj...@huawei.com> --- drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c index 5db63b9f3b70..9bcedfb0adfa 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c @@ -4881,7 +4881,7 @@ static struct dim_cq_moder mlx5e_get_def_tx_moderation(u8 cq_period_mode) static struct dim_cq_moder mlx5e_get_def_rx_moderation(u8 cq_period_mode) { - struct dim_cq_moder moder; + struct dim_cq_moder moder = {}; moder.cq_period_mode = cq_period_mode; moder.pkts = MLX5E_PARAMS_DEFAULT_RX_CQ_MODERATION_PKTS; -- 2.23.0