Skip to content

Commit a84acf7

Browse files
idoschdavem330
authored andcommitted
mlxsw: spectrum_router: Avoid uninitialized symbol errors
Suppress the following smatch errors. None of these are actually possible with current code paths. drivers/net/ethernet/mellanox/mlxsw//spectrum_router.c:1220 mlxsw_sp_ipip_entry_find_decap() error: uninitialized symbol 'saddrp'. drivers/net/ethernet/mellanox/mlxsw//spectrum_router.c:1220 mlxsw_sp_ipip_entry_find_decap() error: uninitialized symbol 'saddr_len'. drivers/net/ethernet/mellanox/mlxsw//spectrum_router.c:1221 mlxsw_sp_ipip_entry_find_decap() error: uninitialized symbol 'saddr_prefix_len'. drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c:1390 mlxsw_sp_netdevice_ipip_ol_reg_event() error: uninitialized symbol 'ipipt'. drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c:3255 mlxsw_sp_nexthop_group_update() error: uninitialized symbol 'err'. Signed-off-by: Ido Schimmel <[email protected]> Reviewed-by: Jiri Pirko <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent cfe9701 commit a84acf7

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1212,7 +1212,7 @@ mlxsw_sp_ipip_entry_find_decap(struct mlxsw_sp *mlxsw_sp,
12121212
saddr_len = 4;
12131213
saddr_prefix_len = 32;
12141214
break;
1215-
case MLXSW_SP_L3_PROTO_IPV6:
1215+
default:
12161216
WARN_ON(1);
12171217
return NULL;
12181218
}
@@ -1380,9 +1380,9 @@ static bool mlxsw_sp_netdevice_ipip_can_offload(struct mlxsw_sp *mlxsw_sp,
13801380
static int mlxsw_sp_netdevice_ipip_ol_reg_event(struct mlxsw_sp *mlxsw_sp,
13811381
struct net_device *ol_dev)
13821382
{
1383+
enum mlxsw_sp_ipip_type ipipt = MLXSW_SP_IPIP_TYPE_MAX;
13831384
struct mlxsw_sp_ipip_entry *ipip_entry;
13841385
enum mlxsw_sp_l3proto ul_proto;
1385-
enum mlxsw_sp_ipip_type ipipt;
13861386
union mlxsw_sp_l3addr saddr;
13871387
u32 ul_tb_id;
13881388

@@ -3231,7 +3231,6 @@ mlxsw_sp_nexthop_group_update(struct mlxsw_sp *mlxsw_sp,
32313231
u32 adj_index = nh_grp->adj_index; /* base */
32323232
struct mlxsw_sp_nexthop *nh;
32333233
int i;
3234-
int err;
32353234

32363235
for (i = 0; i < nh_grp->count; i++) {
32373236
nh = &nh_grp->nexthops[i];
@@ -3242,6 +3241,8 @@ mlxsw_sp_nexthop_group_update(struct mlxsw_sp *mlxsw_sp,
32423241
}
32433242

32443243
if (nh->update || reallocate) {
3244+
int err = 0;
3245+
32453246
switch (nh->type) {
32463247
case MLXSW_SP_NEXTHOP_TYPE_ETH:
32473248
err = mlxsw_sp_nexthop_update

0 commit comments

Comments
 (0)