Skip to content

Commit

Permalink
[CPUFREQ] fix double freeing in error path of pcc-cpufreq
Browse files Browse the repository at this point in the history
Prevent double freeing on error path.

Signed-off-by: Daniel J Blueman <daniel.blueman@gmail.com>
Signed-off-by: Dave Jones <davej@redhat.com>
  • Loading branch information
Daniel J Blueman authored and Dave Jones committed Jul 26, 2010
1 parent 47f8bcf commit 3847d22
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -368,22 +368,16 @@ static int __init pcc_cpufreq_do_osc(acpi_handle *handle)
return -ENODEV;

out_obj = output.pointer;
if (out_obj->type != ACPI_TYPE_BUFFER) {
ret = -ENODEV;
goto out_free;
}
if (out_obj->type != ACPI_TYPE_BUFFER)
return -ENODEV;

errors = *((u32 *)out_obj->buffer.pointer) & ~(1 << 0);
if (errors) {
ret = -ENODEV;
goto out_free;
}
if (errors)
return -ENODEV;

supported = *((u32 *)(out_obj->buffer.pointer + 4));
if (!(supported & 0x1)) {
ret = -ENODEV;
goto out_free;
}
if (!(supported & 0x1))
return -ENODEV;

out_free:
kfree(output.pointer);
Expand Down

0 comments on commit 3847d22

Please sign in to comment.