Skip to content

Commit

Permalink
[CPUFREQ] Fix another notifier leak in powernow-k8.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dave Jones committed Mar 1, 2011
1 parent ac81831 commit a536b12
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/x86/kernel/cpu/cpufreq/powernow-k8.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit a536b12

Please sign in to comment.