lkml.org 
[lkml]   [2010]   [Nov]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: Missing "unregister_cpu_notifier" in powernow-k8.c
On Tue, Nov 23, 2010 at 09:19:38PM -0500, Dave Jones wrote:
> The following might be a partial fix, but I suspect there is probably other
> clean-up that is needed.

Indeed, looks like another possible leak in the unlikely event that the
percpu msr struct can't be allocated..
Instead of adding an unregister on fail, I think we can just move the registration later.

Dave

diff --git a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c
index 812778c..f0a80f1 100644
--- a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c
+++ b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c
@@ -1556,14 +1556,14 @@ static int __cpuinit powernowk8_init(void)

cpb_capable = true;

- register_cpu_notifier(&cpb_nb);
-
msrs = msrs_alloc();
if (!msrs) {
printk(KERN_ERR "%s: Error allocating msrs!\n", __func__);
return -ENOMEM;
}

+ register_cpu_notifier(&cpb_nb);
+
rdmsr_on_cpus(cpu_online_mask, MSR_K7_HWCR, msrs);

for_each_cpu(cpu, cpu_online_mask) {


\
 
 \ /
  Last update: 2010-11-24 03:35    [W:0.049 / U:21.604 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site