diff options
author | Gustavo A. R. Silva <gustavo@embeddedor.com> | 2018-07-31 09:21:57 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-08-01 09:38:05 -0700 |
commit | 96d395020e87607b3454edc2f49a03ddcfbef986 (patch) | |
tree | 00ae6c14f7e91edce0d7a876e080f88baad1dd09 | |
parent | bf774d141a33ea13e8cd11034ada395d3f23ef51 (diff) |
net/mlx5e: Fix uninitialized variable
There is a potential execution path in which variable *err* is returned
without being properly initialized previously.
Fix this by initializing variable *err* to 0.
Addresses-Coverity-ID: 1472116 ("Uninitialized scalar variable")
Fixes: 0ec13877ce95 ("net/mlx5e: Gather all XDP pre-requisite checks in a single function")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Reviewed-by: Tariq Toukan <tariqt@mellanox.com>
Acked-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c index fde35021a257..de2827ad0e67 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c @@ -4215,7 +4215,7 @@ static int mlx5e_xdp_set(struct net_device *netdev, struct bpf_prog *prog) struct mlx5e_priv *priv = netdev_priv(netdev); struct bpf_prog *old_prog; bool reset, was_opened; - int err; + int err = 0; int i; mutex_lock(&priv->state_lock); |