Commit 3847d223f2e4da5ceb47ea8996618010192f3197
Committed by
Dave Jones
1 parent
47f8bcf362
Exists in
master
and in
39 other branches
[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>
Showing 1 changed file with 6 additions and 12 deletions Side-by-side Diff
arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c
... | ... | @@ -368,22 +368,16 @@ |
368 | 368 | return -ENODEV; |
369 | 369 | |
370 | 370 | out_obj = output.pointer; |
371 | - if (out_obj->type != ACPI_TYPE_BUFFER) { | |
372 | - ret = -ENODEV; | |
373 | - goto out_free; | |
374 | - } | |
371 | + if (out_obj->type != ACPI_TYPE_BUFFER) | |
372 | + return -ENODEV; | |
375 | 373 | |
376 | 374 | errors = *((u32 *)out_obj->buffer.pointer) & ~(1 << 0); |
377 | - if (errors) { | |
378 | - ret = -ENODEV; | |
379 | - goto out_free; | |
380 | - } | |
375 | + if (errors) | |
376 | + return -ENODEV; | |
381 | 377 | |
382 | 378 | supported = *((u32 *)(out_obj->buffer.pointer + 4)); |
383 | - if (!(supported & 0x1)) { | |
384 | - ret = -ENODEV; | |
385 | - goto out_free; | |
386 | - } | |
379 | + if (!(supported & 0x1)) | |
380 | + return -ENODEV; | |
387 | 381 | |
388 | 382 | out_free: |
389 | 383 | kfree(output.pointer); |