aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/cpu
diff options
context:
space:
mode:
authorDave Jones <davej@redhat.com>2009-02-18 14:11:00 -0500
committerDave Jones <davej@redhat.com>2009-02-24 22:47:32 -0500
commit0cb8bc256093e716d2a0a4a721f36c625a3f7634 (patch)
tree583d4e23c06480459dd6727dad079283bdb6d92a /arch/x86/kernel/cpu
parentde3ed81d746d7cfc22a0c645244ed9fa71e4a833 (diff)
[CPUFREQ] powernow-k8: Use a common exit path.
a0abd520fd69295f4a3735e29a9448a32e101d47 introduced a slew of extra kfree/return -ENODEV pairs. This replaces them all with gotos. Signed-off-by: Dave Jones <davej@redhat.com>
Diffstat (limited to 'arch/x86/kernel/cpu')
-rw-r--r--arch/x86/kernel/cpu/cpufreq/powernow-k8.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c
index c44853fc827a..a15ac94e0b9b 100644
--- a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c
+++ b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c
@@ -1254,21 +1254,18 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol)
1254 "BIOS vendor.\n"); 1254 "BIOS vendor.\n");
1255 print_once++; 1255 print_once++;
1256 } 1256 }
1257 kfree(data); 1257 goto err_out;
1258 return -ENODEV;
1259 } 1258 }
1260 if (pol->cpu != 0) { 1259 if (pol->cpu != 0) {
1261 printk(KERN_ERR FW_BUG PFX "No ACPI _PSS objects for " 1260 printk(KERN_ERR FW_BUG PFX "No ACPI _PSS objects for "
1262 "CPU other than CPU0. Complain to your BIOS " 1261 "CPU other than CPU0. Complain to your BIOS "
1263 "vendor.\n"); 1262 "vendor.\n");
1264 kfree(data); 1263 goto err_out;
1265 return -ENODEV;
1266 } 1264 }
1267 rc = find_psb_table(data); 1265 rc = find_psb_table(data);
1268 if (rc) { 1266 if (rc)
1269 kfree(data); 1267 goto err_out;
1270 return -ENODEV; 1268
1271 }
1272 /* Take a crude guess here. 1269 /* Take a crude guess here.
1273 * That guess was in microseconds, so multiply with 1000 */ 1270 * That guess was in microseconds, so multiply with 1000 */
1274 pol->cpuinfo.transition_latency = ( 1271 pol->cpuinfo.transition_latency = (
@@ -1283,16 +1280,16 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol)
1283 1280
1284 if (smp_processor_id() != pol->cpu) { 1281 if (smp_processor_id() != pol->cpu) {
1285 printk(KERN_ERR PFX "limiting to cpu %u failed\n", pol->cpu); 1282 printk(KERN_ERR PFX "limiting to cpu %u failed\n", pol->cpu);
1286 goto err_out; 1283 goto err_out_unmask;
1287 } 1284 }
1288 1285
1289 if (pending_bit_stuck()) { 1286 if (pending_bit_stuck()) {
1290 printk(KERN_ERR PFX "failing init, change pending bit set\n"); 1287 printk(KERN_ERR PFX "failing init, change pending bit set\n");
1291 goto err_out; 1288 goto err_out_unmask;
1292 } 1289 }
1293 1290
1294 if (query_current_values_with_pending_wait(data)) 1291 if (query_current_values_with_pending_wait(data))
1295 goto err_out; 1292 goto err_out_unmask;
1296 1293
1297 if (cpu_family == CPU_OPTERON) 1294 if (cpu_family == CPU_OPTERON)
1298 fidvid_msr_init(); 1295 fidvid_msr_init();
@@ -1335,10 +1332,11 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol)
1335 1332
1336 return 0; 1333 return 0;
1337 1334
1338err_out: 1335err_out_unmask:
1339 set_cpus_allowed_ptr(current, &oldmask); 1336 set_cpus_allowed_ptr(current, &oldmask);
1340 powernow_k8_cpu_exit_acpi(data); 1337 powernow_k8_cpu_exit_acpi(data);
1341 1338
1339err_out:
1342 kfree(data); 1340 kfree(data);
1343 return -ENODEV; 1341 return -ENODEV;
1344} 1342}