Skip to content

Commit e25f304

Browse files
idoschkuba-moo
authored andcommitted
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]>
1 parent fb76ea1 commit e25f304

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ mlxsw_thermal_modules_init(struct device *dev, struct mlxsw_core *core,
509509
return 0;
510510

511511
err_thermal_module_init:
512-
for (i = area->tz_module_num - 1; i >= 0; i--)
512+
for (i--; i >= 0; i--)
513513
mlxsw_thermal_module_fini(&area->tz_module_arr[i]);
514514
kfree(area->tz_module_arr);
515515
return err;

0 commit comments

Comments
 (0)