net/mlx5e: Fix uninitialized variable
Subsystems (5)
PATCH 1/1 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")
--- drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlx5/core/en_main.c +1 -1
@@ -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);
Signature · 1 line
2.7.4
Quoted 18 lines · Gustavo A. R. Silva
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 <[email protected]>--- drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/ethernet/mellanox/mlx5/core/en_main.c +0
-0
drivers/net/ethernet/mellanox/mlx5/core/en_main.c static int mlx5e_xdp_set(struct net_device *netdev, struct bpf_prog *prog) · line 4221
Quoted 8 lines
drivers/net/ethernet/mellanox/mlx5/core/en_main.c +1
-1@@ -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);
Thanks.
Quoted 8 lines · Gustavo A. R. Silva
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 <[email protected]>
From: "Gustavo A. R. Silva" <[email protected]>
Date: Tue, 31 Jul 2018 09:21:57 -0500
Quoted 8 lines
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 <[email protected]>
Applied to net-next.
Quoted 6 lines · David Miller
From: "Gustavo A. R. Silva" <[email protected]>
Date: Tue, 31 Jul 2018 09:21:57 -0500Quoted 3 lines
There is a potential execution path in which variable *err* is returned without being properly initialized previously.
Quoted 8 lines
Quoted 5 lines
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 <[email protected]>Applied to net-next.
David,
Sorry I failed to tag this patch for net-next. I got a bit confused, once based on the logs, the usual committer for this driver is Saeed Mahameed; not you. So, I wasn't quite sure about how to proceed.
Thanks