Commit bd08ee23 authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 'mlxsw-fixes'



Ido Schimmel says:

====================
mlxsw: Two small fixes

Patch #1 fixes a recent regression that prevents the driver from loading
with old firmware versions.

Patch #2 protects the driver from a NULL pointer dereference when
working on top of a buggy firmware. This was never observed in an actual
system, only on top of an emulator during development.
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 5789d04b 63b08b1f
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -2153,7 +2153,7 @@ static void mlxsw_sp_pude_event_func(const struct mlxsw_reg_info *reg,
	max_ports = mlxsw_core_max_ports(mlxsw_sp->core);
	local_port = mlxsw_reg_pude_local_port_get(pude_pl);

	if (WARN_ON_ONCE(local_port >= max_ports))
	if (WARN_ON_ONCE(!local_port || local_port >= max_ports))
		return;
	mlxsw_sp_port = mlxsw_sp->ports[local_port];
	if (!mlxsw_sp_port)
@@ -3290,8 +3290,8 @@ mlxsw_sp_resources_rif_mac_profile_register(struct mlxsw_core *mlxsw_core)
	u8 max_rif_mac_profiles;

	if (!MLXSW_CORE_RES_VALID(mlxsw_core, MAX_RIF_MAC_PROFILES))
		return -EIO;

		max_rif_mac_profiles = 1;
	else
		max_rif_mac_profiles = MLXSW_CORE_RES_GET(mlxsw_core,
							  MAX_RIF_MAC_PROFILES);
	devlink_resource_size_params_init(&size_params, max_rif_mac_profiles,