Skip to content

Commit 523779c

Browse files
idoschdavem330
authored andcommitted
mlxsw: core: Change order of operations in removal path
We call bus->init() before allocating 'lag.mapping'. Change the order of operations in removal path to reflect that. This makes the error path of mlxsw_core_bus_device_register() symmetric with mlxsw_core_bus_device_unregister(). Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 81d4d72 commit 523779c

File tree

1 file changed

+1
-1
lines changed
  • drivers/net/ethernet/mellanox/mlxsw

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1188,8 +1188,8 @@ void mlxsw_core_bus_device_unregister(struct mlxsw_core *mlxsw_core)
11881188
mlxsw_thermal_fini(mlxsw_core->thermal);
11891189
devlink_unregister(devlink);
11901190
mlxsw_emad_fini(mlxsw_core);
1191-
mlxsw_core->bus->fini(mlxsw_core->bus_priv);
11921191
kfree(mlxsw_core->lag.mapping);
1192+
mlxsw_core->bus->fini(mlxsw_core->bus_priv);
11931193
free_percpu(mlxsw_core->pcpu_stats);
11941194
devlink_free(devlink);
11951195
mlxsw_core_driver_put(device_kind);

0 commit comments

Comments
 (0)