Skip to content

Commit 1547f53

Browse files
Colin Ian Kingdavem330
authored andcommitted
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: eeb66cd ("net/mlx5: Separate between E-Switch and MPFS") Signed-off-by: Colin Ian King <colin.king@canonical.com> Reviewed-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 16a4362 commit 1547f53

File tree

1 file changed

+1
-1
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core

1 file changed

+1
-1
lines changed

drivers/net/ethernet/mellanox/mlx5/core/eswitch.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ static int esw_add_uc_addr(struct mlx5_eswitch *esw, struct vport_addr *vaddr)
401401
esw_debug(esw->dev, "\tADDED UC MAC: vport[%d] %pM fr(%p)\n",
402402
vport, mac, vaddr->flow_rule);
403403

404-
return err;
404+
return 0;
405405
}
406406

407407
static int esw_del_uc_addr(struct mlx5_eswitch *esw, struct vport_addr *vaddr)

0 commit comments

Comments
 (0)