diff options
author | Ido Schimmel <[email protected]> | 2024-07-30 15:58:18 +0200 |
---|---|---|
committer | Jakub Kicinski <[email protected]> | 2024-07-31 18:38:28 -0700 |
commit | e25f3040a61961c9f1bcb896b983a33b64d978e2 (patch) | |
tree | 231e9cd07207a75381789f3f9d3c7b4a0188fdd4 | |
parent | fb76ea1d4b12dab4ad1573f16b340e97174269b6 (diff) |
mlxsw: core_thermal: Simplify rollback
During rollback, instead of calling mlxsw_thermal_module_fini() for all
the modules, only call it for modules that were successfully
initialized. This is not a bug fix since mlxsw_thermal_module_fini()
first checks that the module was initialized.
Signed-off-by: Ido Schimmel <[email protected]>
Reviewed-by: Vadim Pasternak <[email protected]>
Signed-off-by: Petr Machata <[email protected]>
Reviewed-by: Wojciech Drewek <[email protected]>
Link: https://patch.msgid.link/905bebc45f6e246031f0c5c177bba8efe11e05f5.1722345311.git.petrm@nvidia.com
Signed-off-by: Jakub Kicinski <[email protected]>
-rw-r--r-- | drivers/net/ethernet/mellanox/mlxsw/core_thermal.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c index 36b883a7ee60..e9bf11a38ae9 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c +++ b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c @@ -509,7 +509,7 @@ mlxsw_thermal_modules_init(struct device *dev, struct mlxsw_core *core, return 0; err_thermal_module_init: - for (i = area->tz_module_num - 1; i >= 0; i--) + for (i--; i >= 0; i--) mlxsw_thermal_module_fini(&area->tz_module_arr[i]); kfree(area->tz_module_arr); return err; |