Commit 0cb8bc25 authored by Dave Jones's avatar Dave Jones

[CPUFREQ] powernow-k8: Use a common exit path.

a0abd520 introduced a slew of
extra kfree/return -ENODEV pairs. This replaces them all
with gotos.
Signed-off-by: default avatarDave Jones <davej@redhat.com>
parent de3ed81d
...@@ -1254,21 +1254,18 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol) ...@@ -1254,21 +1254,18 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol)
"BIOS vendor.\n"); "BIOS vendor.\n");
print_once++; print_once++;
} }
kfree(data); goto err_out;
return -ENODEV;
} }
if (pol->cpu != 0) { if (pol->cpu != 0) {
printk(KERN_ERR FW_BUG PFX "No ACPI _PSS objects for " printk(KERN_ERR FW_BUG PFX "No ACPI _PSS objects for "
"CPU other than CPU0. Complain to your BIOS " "CPU other than CPU0. Complain to your BIOS "
"vendor.\n"); "vendor.\n");
kfree(data); goto err_out;
return -ENODEV;
} }
rc = find_psb_table(data); rc = find_psb_table(data);
if (rc) { if (rc)
kfree(data); goto err_out;
return -ENODEV;
}
/* Take a crude guess here. /* Take a crude guess here.
* That guess was in microseconds, so multiply with 1000 */ * That guess was in microseconds, so multiply with 1000 */
pol->cpuinfo.transition_latency = ( pol->cpuinfo.transition_latency = (
...@@ -1283,16 +1280,16 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol) ...@@ -1283,16 +1280,16 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol)
if (smp_processor_id() != pol->cpu) { if (smp_processor_id() != pol->cpu) {
printk(KERN_ERR PFX "limiting to cpu %u failed\n", pol->cpu); printk(KERN_ERR PFX "limiting to cpu %u failed\n", pol->cpu);
goto err_out; goto err_out_unmask;
} }
if (pending_bit_stuck()) { if (pending_bit_stuck()) {
printk(KERN_ERR PFX "failing init, change pending bit set\n"); printk(KERN_ERR PFX "failing init, change pending bit set\n");
goto err_out; goto err_out_unmask;
} }
if (query_current_values_with_pending_wait(data)) if (query_current_values_with_pending_wait(data))
goto err_out; goto err_out_unmask;
if (cpu_family == CPU_OPTERON) if (cpu_family == CPU_OPTERON)
fidvid_msr_init(); fidvid_msr_init();
...@@ -1335,10 +1332,11 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol) ...@@ -1335,10 +1332,11 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol)
return 0; return 0;
err_out: err_out_unmask:
set_cpus_allowed_ptr(current, &oldmask); set_cpus_allowed_ptr(current, &oldmask);
powernow_k8_cpu_exit_acpi(data); powernow_k8_cpu_exit_acpi(data);
err_out:
kfree(data); kfree(data);
return -ENODEV; return -ENODEV;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment