diff options
author | Daniel J Blueman <daniel.blueman@gmail.com> | 2010-07-23 18:06:52 -0400 |
---|---|---|
committer | Dave Jones <davej@redhat.com> | 2010-07-26 15:25:34 -0400 |
commit | 3847d223f2e4da5ceb47ea8996618010192f3197 (patch) | |
tree | 05e83cca56e1f887f4b59a76f4d63a1016644d8d /arch | |
parent | 47f8bcf362410b631a4d99ff5c79ec6b9dd3ace6 (diff) |
[CPUFREQ] fix double freeing in error path of pcc-cpufreq
Prevent double freeing on error path.
Signed-off-by: Daniel J Blueman <daniel.blueman@gmail.com>
Signed-off-by: Dave Jones <davej@redhat.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c b/arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c index 01bd25c3c7ca..900702888bfb 100644 --- a/arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c +++ b/arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c | |||
@@ -368,22 +368,16 @@ static int __init pcc_cpufreq_do_osc(acpi_handle *handle) | |||
368 | return -ENODEV; | 368 | return -ENODEV; |
369 | 369 | ||
370 | out_obj = output.pointer; | 370 | out_obj = output.pointer; |
371 | if (out_obj->type != ACPI_TYPE_BUFFER) { | 371 | if (out_obj->type != ACPI_TYPE_BUFFER) |
372 | ret = -ENODEV; | 372 | return -ENODEV; |
373 | goto out_free; | ||
374 | } | ||
375 | 373 | ||
376 | errors = *((u32 *)out_obj->buffer.pointer) & ~(1 << 0); | 374 | errors = *((u32 *)out_obj->buffer.pointer) & ~(1 << 0); |
377 | if (errors) { | 375 | if (errors) |
378 | ret = -ENODEV; | 376 | return -ENODEV; |
379 | goto out_free; | ||
380 | } | ||
381 | 377 | ||
382 | supported = *((u32 *)(out_obj->buffer.pointer + 4)); | 378 | supported = *((u32 *)(out_obj->buffer.pointer + 4)); |
383 | if (!(supported & 0x1)) { | 379 | if (!(supported & 0x1)) |
384 | ret = -ENODEV; | 380 | return -ENODEV; |
385 | goto out_free; | ||
386 | } | ||
387 | 381 | ||
388 | out_free: | 382 | out_free: |
389 | kfree(output.pointer); | 383 | kfree(output.pointer); |