mlxsw: spectrum: Fix order of commands in port remove function
authorYotam Gigi <yotamg@mellanox.com>
Mon, 9 Jan 2017 10:25:47 +0000 (11:25 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 9 Jan 2017 19:35:14 +0000 (14:35 -0500)
Fix the order of the free directives to match the port init function

Signed-off-by: Yotam Gigi <yotamg@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum.c

index f4b8ba21dd8f45c21a6a66d4a6adfe307b837123..1f4fdce7efa48977c0633016d4ac5cc3199df27f 100644 (file)
@@ -2431,8 +2431,8 @@ static void __mlxsw_sp_port_remove(struct mlxsw_sp *mlxsw_sp, u8 local_port)
        mlxsw_sp_port_dcb_fini(mlxsw_sp_port);
        mlxsw_sp_port_swid_set(mlxsw_sp_port, MLXSW_PORT_SWID_DISABLED_PORT);
        mlxsw_sp_port_module_unmap(mlxsw_sp, mlxsw_sp_port->local_port);
-       free_percpu(mlxsw_sp_port->pcpu_stats);
        kfree(mlxsw_sp_port->hw_stats.cache);
+       free_percpu(mlxsw_sp_port->pcpu_stats);
        kfree(mlxsw_sp_port->untagged_vlans);
        kfree(mlxsw_sp_port->active_vlans);
        WARN_ON_ONCE(!list_empty(&mlxsw_sp_port->vports_list));