mirror of
https://github.com/torvalds/linux.git
synced 2026-05-31 18:43:33 +02:00
mlxsw: spectrum_router: Avoid missing error code warning
Explicitly set the error code to zero before the goto statement to avoid the following smatch warning: drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c:3598 mlxsw_sp_nexthop_group_refresh() warn: missing error code 'err' The warning is a false positive, but the change both suppresses the warning and makes it clear to future readers that this is not an error path. The original report and discussion can be found here [1]. [1] https://lore.kernel.org/lkml/202105141823.Td2h3Mbi-lkp@intel.com/ Cc: Dan Carpenter <dan.carpenter@oracle.com> Suggested-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Ido Schimmel <idosch@nvidia.com> Reviewed-by: Petr Machata <petrm@nvidia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
8c2b58e65d
commit
51746a353b
|
|
@ -3844,8 +3844,8 @@ mlxsw_sp_nexthop_group_refresh(struct mlxsw_sp *mlxsw_sp,
|
|||
bool offload_change = false;
|
||||
u32 adj_index;
|
||||
bool old_adj_index_valid;
|
||||
int i, err2, err = 0;
|
||||
u32 old_adj_index;
|
||||
int i, err2, err;
|
||||
|
||||
if (!nhgi->gateway)
|
||||
return mlxsw_sp_nexthop_fib_entries_update(mlxsw_sp, nh_grp);
|
||||
|
|
@ -3875,11 +3875,13 @@ mlxsw_sp_nexthop_group_refresh(struct mlxsw_sp *mlxsw_sp,
|
|||
return 0;
|
||||
}
|
||||
mlxsw_sp_nexthop_group_normalize(nhgi);
|
||||
if (!nhgi->sum_norm_weight)
|
||||
if (!nhgi->sum_norm_weight) {
|
||||
/* No neigh of this group is connected so we just set
|
||||
* the trap and let everthing flow through kernel.
|
||||
*/
|
||||
err = 0;
|
||||
goto set_trap;
|
||||
}
|
||||
|
||||
ecmp_size = nhgi->sum_norm_weight;
|
||||
err = mlxsw_sp_fix_adj_grp_size(mlxsw_sp, &ecmp_size);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user