From: Colin Ian King Date: Fri, 18 Aug 2017 13:49:25 +0000 (+0100) Subject: mlx5: ensure 0 is returned when vport is zero X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1547f538c14581346c2eb82f8af0071ee6ec2b30;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git mlx5: ensure 0 is returned when vport is zero Currently, if vport is zero then then an uninialized return status in err is returned. Since the only return status at the end of the function esw_add_uc_addr is zero for the current set of return paths we may as well just return 0 rather than err to fix this issue. Detected by CoverityScan, CID#1452698 ("Uninitialized scalar variable") Fixes: eeb66cdb6826 ("net/mlx5: Separate between E-Switch and MPFS") Signed-off-by: Colin Ian King Reviewed-by: Leon Romanovsky Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c index fd51f0ea8df9..6b84c1113301 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c @@ -401,7 +401,7 @@ fdb_add: esw_debug(esw->dev, "\tADDED UC MAC: vport[%d] %pM fr(%p)\n", vport, mac, vaddr->flow_rule); - return err; + return 0; } static int esw_del_uc_addr(struct mlx5_eswitch *esw, struct vport_addr *vaddr)