Skip to contentSkip to conversation

cpufreq: ia64: Fix a memory leak in acpi_cpufreq_cpu_exit

PATCH Applied Pan Xinhui 2 participants 3 messages Jul 20, 2015 – Jul 23, 2015 CPU frequency scaling framework

lore
Share & tools
lore

Pan Xinhui

author
#0 lore raw

PATCH 1/1 cpufreq: ia64: Fix a memory leak in acpi_cpufreq_cpu_exit

From: Pan Xinhui <[email protected]>

freq_table should be alloced in ->init and freed in ->exit. However it does not be freed. Fix this memory leak in acpi_cpufreq_cpu_exit.

---
 drivers/cpufreq/ia64-acpi-cpufreq.c | 1 +
 1 file changed, 1 insertion(+)
drivers/cpufreq/ia64-acpi-cpufreq.c +1 -0
index 27cef0c..e02bd15 100644
@@ -334,6 +334,7 @@ acpi_cpufreq_cpu_exit (
 		acpi_io_data[policy->cpu] = NULL;
 		acpi_processor_unregister_performance(&data->acpi_data,
 		                                      policy->cpu);
+		kfree(policy->freq_table);
 		kfree(data);
 	}
 
Signature · 1 line
1.9.1
author
#1 lore raw

hi, all
ia64-acpi-cpufreq has similar issues with acpi-cpufreq. Maybe we need make other two patches.
Replace struct cpufreq_acpi_io *acpi_io_data[NR_CPUS] with policy->driver_data, and Fix an acpi perf unregister issue.

As two patches
[1/2] Drop the unused first argument of acpi_processor_unregister_performance(). [2/2] Drop the now redundant acpi_data pointer from acpi_cpufreq_data.
are going into the kernel tree, If I send my patches to you now, there will be some conflicts.

So I may wait for a couple of days until all previous patches merged into kernel tree.

thanks
xinhui

Quoted 23 lines · Pan Xinhui

From: Pan Xinhui <[email protected]>

freq_table should be alloced in ->init and freed in ->exit. However it does not be freed. Fix this memory leak in acpi_cpufreq_cpu_exit.

---
 drivers/cpufreq/ia64-acpi-cpufreq.c | 1 +
 1 file changed, 1 insertion(+)
drivers/cpufreq/ia64-acpi-cpufreq.c +1 -0
index 27cef0c..e02bd15 100644
@@ -334,6 +334,7 @@ acpi_cpufreq_cpu_exit (
 		acpi_io_data[policy->cpu] = NULL;
 		acpi_processor_unregister_performance(&data->acpi_data,
 		                                      policy->cpu);
+		kfree(policy->freq_table);
 		kfree(data);
 	}