Commit 5a4bbd01c8516d4f116c32e6c4b64bfd5e5fe10d

Authored by Linus Torvalds

Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/davej/cpufreq

* 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/davej/cpufreq:
  [CPUFREQ] Fix memory leaks in pcc_cpufreq_do_osc
  [CPUFREQ] acpi-cpufreq: add missing __percpu markup

Showing 1 changed file Side-by-side Diff

arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c
... ... @@ -368,16 +368,22 @@
368 368 return -ENODEV;
369 369  
370 370 out_obj = output.pointer;
371   - if (out_obj->type != ACPI_TYPE_BUFFER)
372   - return -ENODEV;
  371 + if (out_obj->type != ACPI_TYPE_BUFFER) {
  372 + ret = -ENODEV;
  373 + goto out_free;
  374 + }
373 375  
374 376 errors = *((u32 *)out_obj->buffer.pointer) & ~(1 << 0);
375   - if (errors)
376   - return -ENODEV;
  377 + if (errors) {
  378 + ret = -ENODEV;
  379 + goto out_free;
  380 + }
377 381  
378 382 supported = *((u32 *)(out_obj->buffer.pointer + 4));
379   - if (!(supported & 0x1))
380   - return -ENODEV;
  383 + if (!(supported & 0x1)) {
  384 + ret = -ENODEV;
  385 + goto out_free;
  386 + }
381 387  
382 388 out_free:
383 389 kfree(output.pointer);