net/mlx5: Bridge, fix uninitialized variable in mlx5_esw_bridge_port_changeupper()
Subsystems (4)
PATCH 1/1 net/mlx5: Bridge, fix uninitialized variable in mlx5_esw_bridge_port_changeupper()
A recent change removed code that initialized the return code variable 'err'. It is now possible for mlx5_esw_bridge_port_changeupper() to return an error code using this uninitialized variable. Fix it by initializing to 0.
Addresses-Coverity: ("Uninitialized scalar variable (UNINIT)")
--- drivers/net/ethernet/mellanox/mlx5/core/en/rep/bridge.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlx5/core/en/rep/bridge.c +1 -1
@@ -137,7 +137,7 @@ static int mlx5_esw_bridge_port_changeupper(struct notifier_block *nb, void *ptru16 vport_num, esw_owner_vhca_id;struct netlink_ext_ack *extack;int ifindex = upper->ifindex; -int err; +int err =0 ;if (!netif_is_bridge_master (upper))return 0 ;
Signature · 1 line
2.33.0
Quoted 19 lines · Tim Gardner
A recent change removed code that initialized the return code variable 'err'. It is now possible for
mlx5_esw_bridge_port_changeupper()to return an error code using this uninitialized variable. Fix it by initializing to 0.Addresses-Coverity: ("Uninitialized scalar variable (UNINIT)")
Cc Saeed Mahameed <[email protected]>Cc Leon Romanovsky <[email protected]>Cc "David S. Miller" <[email protected]>Cc Jakub Kicinski <[email protected]>Cc Vlad Buslov <[email protected]>Cc Jianbo Liu <[email protected]>Cc Mark Bloch <[email protected]>Cc Roi Dayan <[email protected]>Cc Vladimir Oltean <[email protected]>Signed-off-by Tim Gardner <[email protected]>
Quoted 1 line
---
Tim, thanks for fixing this!
Saeed, this is the second similar issue that I mentioned in my reply to Colin. Again, I've already submitted same patch internally and this one is as good as mine.
[...]
Saeed Mahameed
maintainerQuoted 10 lines · Vlad Buslov
Quoted 8 lines · Tim Gardner
A recent change removed code that initialized the return code variable 'err'. It
is now possible formlx5_esw_bridge_port_changeupper()to return an error code
using this uninitialized variable. Fix it by initializing to 0.Addresses-Coverity: ("Uninitialized scalar variable (UNINIT)")
Quoted 12 lines
Quoted 4 lines
Cc Saeed Mahameed <[email protected]>Cc Leon Romanovsky <[email protected]>Cc "David S. Miller" <[email protected]>Cc Jakub Kicinski <[email protected]>Quoted 8 lines
Cc Vlad Buslov <[email protected]>Cc Jianbo Liu <[email protected]>Cc Mark Bloch <[email protected]>Cc Roi Dayan <[email protected]>Cc Vladimir Oltean <[email protected]>
Just wondering, do we really need 12 inline CCs for fixing a poor coverity?
Quoted 10 lines
Quoted 2 lines
Signed-off-by Tim Gardner <[email protected]>---
Tim, thanks for fixing this!
Saeed, this is the second similar issue that I mentioned in my reply to
Colin. Again, I've already submitted same patch internally and this one
is as good as mine.
I don't mind both patches are perfect.
Quoted 6 lines
Reviewed-by Vlad Buslov <[email protected]>[...]