OSDN Git Service

net/mlx5: Fix uninitialized variable warning
authorMoshe Tal <moshet@mellanox.com>
Thu, 16 Jul 2020 11:59:30 +0000 (14:59 +0300)
committerSaeed Mahameed <saeedm@nvidia.com>
Tue, 15 Sep 2020 18:59:48 +0000 (11:59 -0700)
Add variable initialization to eliminate the warning
"variable may be used uninitialized".

Fixes: 5f29458b77d5 ("net/mlx5e: Support dump callback in TX reporter")
Signed-off-by: Moshe Tal <moshet@mellanox.com>
Reviewed-by: Aya Levin <ayal@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/en/health.c

index 3dc200b..69a05da 100644 (file)
@@ -242,8 +242,8 @@ static int mlx5e_health_rsc_fmsg_binary(struct devlink_fmsg *fmsg,
 
 {
        u32 data_size;
+       int err = 0;
        u32 offset;
-       int err;
 
        for (offset = 0; offset < value_len; offset += data_size) {
                data_size = value_len - offset;