Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a133318c authored by Ido Schimmel's avatar Ido Schimmel Committed by David S. Miller
Browse files

mlxsw: spectrum: Mark unused ports using NULL



When splitting and unsplitting we'll destroy usable ports on the fly, so
mark them using a NULL pointer to indicate that their local port number
is free and can be re-used.

Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 558c2d5e
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1518,6 +1518,7 @@ static void mlxsw_sp_port_remove(struct mlxsw_sp *mlxsw_sp, u8 local_port)

	if (!mlxsw_sp_port)
		return;
	mlxsw_sp->ports[local_port] = NULL;
	devlink_port = &mlxsw_sp_port->devlink_port;
	devlink_port_type_clear(devlink_port);
	unregister_netdev(mlxsw_sp_port->dev); /* This calls ndo_stop */