linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cpufreq: ia64: Fix a memory leak in acpi_cpufreq_cpu_exit
@ 2015-07-20  6:24 Pan Xinhui
  2015-07-20  8:13 ` Pan Xinhui
  2015-07-23 21:05 ` Rafael J. Wysocki
  0 siblings, 2 replies; 3+ messages in thread
From: Pan Xinhui @ 2015-07-20  6:24 UTC (permalink / raw)
  To: linux-kernel, linux-pm
  Cc: Rafael J. Wysocki, Viresh Kumar, yanmin_zhang, mnipxh

From: Pan Xinhui <xinhuix.pan@intel.com>

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.

Signed-off-by: Pan Xinhui <xinhuix.pan@intel.com>
---
 drivers/cpufreq/ia64-acpi-cpufreq.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/cpufreq/ia64-acpi-cpufreq.c b/drivers/cpufreq/ia64-acpi-cpufreq.c
index 27cef0c..e02bd15 100644
--- a/drivers/cpufreq/ia64-acpi-cpufreq.c
+++ b/drivers/cpufreq/ia64-acpi-cpufreq.c
@@ -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);
 	}
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] cpufreq: ia64: Fix a memory leak in acpi_cpufreq_cpu_exit
  2015-07-20  6:24 [PATCH] cpufreq: ia64: Fix a memory leak in acpi_cpufreq_cpu_exit Pan Xinhui
@ 2015-07-20  8:13 ` Pan Xinhui
  2015-07-23 21:05 ` Rafael J. Wysocki
  1 sibling, 0 replies; 3+ messages in thread
From: Pan Xinhui @ 2015-07-20  8:13 UTC (permalink / raw)
  To: linux-kernel, linux-pm
  Cc: Rafael J. Wysocki, Viresh Kumar, yanmin_zhang, mnipxh

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

On 2015年07月20日 14:24, Pan Xinhui wrote:
> From: Pan Xinhui <xinhuix.pan@intel.com>
> 
> 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.
> 
> Signed-off-by: Pan Xinhui <xinhuix.pan@intel.com>
> ---
>  drivers/cpufreq/ia64-acpi-cpufreq.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/cpufreq/ia64-acpi-cpufreq.c b/drivers/cpufreq/ia64-acpi-cpufreq.c
> index 27cef0c..e02bd15 100644
> --- a/drivers/cpufreq/ia64-acpi-cpufreq.c
> +++ b/drivers/cpufreq/ia64-acpi-cpufreq.c
> @@ -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);
>  	}
>  
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] cpufreq: ia64: Fix a memory leak in acpi_cpufreq_cpu_exit
  2015-07-20  6:24 [PATCH] cpufreq: ia64: Fix a memory leak in acpi_cpufreq_cpu_exit Pan Xinhui
  2015-07-20  8:13 ` Pan Xinhui
@ 2015-07-23 21:05 ` Rafael J. Wysocki
  1 sibling, 0 replies; 3+ messages in thread
From: Rafael J. Wysocki @ 2015-07-23 21:05 UTC (permalink / raw)
  To: Pan Xinhui
  Cc: linux-kernel, linux-pm, Rafael J. Wysocki, Viresh Kumar,
	yanmin_zhang, mnipxh

On Monday, July 20, 2015 02:24:36 PM Pan Xinhui wrote:
> From: Pan Xinhui <xinhuix.pan@intel.com>
> 
> 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.
> 
> Signed-off-by: Pan Xinhui <xinhuix.pan@intel.com>

Queued up for 4.3, thanks!


-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-07-23 20:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-20  6:24 [PATCH] cpufreq: ia64: Fix a memory leak in acpi_cpufreq_cpu_exit Pan Xinhui
2015-07-20  8:13 ` Pan Xinhui
2015-07-23 21:05 ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).