PM: energy_model: Replace kfree() with em_table_free()
Subsystems (3)
PATCH 1/1 PM: energy_model: Replace kfree() with em_table_free()
Replace kfree() with em_table_free() for error path of em_create_pd() to ensure proper cleanup of energy model tables. The em_table_free() function provides the correct deallocation mechanism for energy model table structures, ensuring consistent memory management throughout the energy model subsystem.
--- kernel/power/energy_model.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/power/energy_model.c +1 -1
@@ -441,7 +441,7 @@ static int em_create_pd(struct device *dev, int nr_states,return 0 ; free_pd_table: -kfree (em_table); +em_table_free (em_table); free_pd:kfree (pd);return -EINVAL ;
Signature · 1 line
2.34.1
Quoted 16 lines · Kaushlendra Kumar
Replace
kfree()withem_table_free()for error path ofem_create_pd()to ensure proper cleanup of energy model tables. Theem_table_free()function provides the correct deallocation mechanism for energy model table structures, ensuring consistent memory management throughout the energy model subsystem.Signed-off-by Kaushlendra Kumar <[email protected]>--- kernel/power/energy_model.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)kernel/power/energy_model.c +0
-0
kernel/power/energy_model.c static int em_create_pd(struct device *dev, int nr_states, · line 447
Quoted 8 lines
kernel/power/energy_model.c +1
-1@@ -441,7 +441,7 @@ static int em_create_pd(struct device *dev, int nr_states,return 0 ; free_pd_table: -kfree (em_table); +em_table_free (em_table); free_pd:kfree (pd);return -EINVAL ;
I guess this could carry the fixes tag as well.
Lukasz Luba
maintainerQuoted 19 lines · Christian Loehle
Quoted 18 lines · Kaushlendra Kumar
Replace
kfree()withem_table_free()for error path ofem_create_pd()to ensure proper cleanup of energy model tables. Theem_table_free()function provides the correct deallocation mechanism for energy model table structures, ensuring consistent memory management throughout the energy model subsystem.Signed-off-by Kaushlendra Kumar <[email protected]>--- kernel/power/energy_model.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)kernel/power/energy_model.c +0
-0@@ -441,7 +441,7 @@ static int em_create_pd(struct device *dev, int nr_states,return 0 ;
Quoted 8 lines
kernel/power/energy_model.c static int em_create_pd(struct device *dev, int nr_states, · line 447
Quoted 6 lines
kernel/power/energy_model.c +1
-1free_pd_table: -kfree (em_table); +em_table_free (em_table); free_pd:kfree (pd);return -EINVAL ;I guess this could carry the fixes tag as well.
It was already discussed with NACK, which still holds.