forked from Minki/linux
[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>
This commit is contained in:
parent
ac81831449
commit
a536b126f2
|
@ -1556,14 +1556,14 @@ static int __cpuinit powernowk8_init(void)
|
||||||
|
|
||||||
cpb_capable = true;
|
cpb_capable = true;
|
||||||
|
|
||||||
register_cpu_notifier(&cpb_nb);
|
|
||||||
|
|
||||||
msrs = msrs_alloc();
|
msrs = msrs_alloc();
|
||||||
if (!msrs) {
|
if (!msrs) {
|
||||||
printk(KERN_ERR "%s: Error allocating msrs!\n", __func__);
|
printk(KERN_ERR "%s: Error allocating msrs!\n", __func__);
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
register_cpu_notifier(&cpb_nb);
|
||||||
|
|
||||||
rdmsr_on_cpus(cpu_online_mask, MSR_K7_HWCR, msrs);
|
rdmsr_on_cpus(cpu_online_mask, MSR_K7_HWCR, msrs);
|
||||||
|
|
||||||
for_each_cpu(cpu, cpu_online_mask) {
|
for_each_cpu(cpu, cpu_online_mask) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user