]> git.baikalelectronics.ru Git - kernel.git/commit
mlx5: ensure 0 is returned when vport is zero
authorColin Ian King <colin.king@canonical.com>
Fri, 18 Aug 2017 13:49:25 +0000 (14:49 +0100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 18 Aug 2017 23:28:40 +0000 (16:28 -0700)
commit2b9ca505847bb2c1396e60150a22e0fdd39164cc
tree4230c146ca6ec412470ca2bae3b163fff97f1d80
parent969a6350c6bbff5a98965c25a8e8afbdf332bc0c
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: 6633d33cbff5 ("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>
drivers/net/ethernet/mellanox/mlx5/core/eswitch.c