diff options
author | Dave Jones <davej@redhat.com> | 2010-11-23 21:29:31 -0500 |
---|---|---|
committer | Dave Jones <davej@redhat.com> | 2011-03-01 18:49:44 -0500 |
commit | a536b126f211bdf9a0eecce0d403a26900d2106c (patch) | |
tree | 50571a71a0109bd0a99528c715dc2d746c80568d /arch/x86/kernel/cpu/cpufreq/powernow-k8.c | |
parent | ac818314499b707a97690d5ee835e6ba40a407c1 (diff) |
[CPUFREQ] Fix another notifier leak in powernow-k8.
Do the notifier registration later, so we don't have to worry
about freeing it if we fail the msr allocation.
Signed-off-by: Dave Jones <davej@redhat.com>
Diffstat (limited to 'arch/x86/kernel/cpu/cpufreq/powernow-k8.c')
-rw-r--r-- | arch/x86/kernel/cpu/cpufreq/powernow-k8.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c index 302963fb4dc3..c567dec854f6 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) | |||
1556 | 1556 | ||
1557 | cpb_capable = true; | 1557 | cpb_capable = true; |
1558 | 1558 | ||
1559 | register_cpu_notifier(&cpb_nb); | ||
1560 | |||
1561 | msrs = msrs_alloc(); | 1559 | msrs = msrs_alloc(); |
1562 | if (!msrs) { | 1560 | if (!msrs) { |
1563 | printk(KERN_ERR "%s: Error allocating msrs!\n", __func__); | 1561 | printk(KERN_ERR "%s: Error allocating msrs!\n", __func__); |
1564 | return -ENOMEM; | 1562 | return -ENOMEM; |
1565 | } | 1563 | } |
1566 | 1564 | ||
1565 | register_cpu_notifier(&cpb_nb); | ||
1566 | |||
1567 | rdmsr_on_cpus(cpu_online_mask, MSR_K7_HWCR, msrs); | 1567 | rdmsr_on_cpus(cpu_online_mask, MSR_K7_HWCR, msrs); |
1568 | 1568 | ||
1569 | for_each_cpu(cpu, cpu_online_mask) { | 1569 | for_each_cpu(cpu, cpu_online_mask) { |