ACPI / CPPC: Fix potential memory leak
authorAshwin Chaugule <ashwin.chaugule@linaro.org>
Fri, 23 Oct 2015 09:02:52 +0000 (05:02 -0400)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 26 Oct 2015 03:47:02 +0000 (04:47 +0100)
Commit 337aadff8e45 (ACPI: Introduce CPU performance controls using CPPC)
leads to the following static checker warning:

        drivers/acpi/cppc_acpi.c:527 acpi_cppc_processor_probe()
        warn: overwrite may leak 'cpc_ptr'

Fix the warning by removing the bogus per-CPU pointer dereference.

Fixes: 337aadff8e45 (ACPI: Introduce CPU performance controls using CPPC)
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Ashwin Chaugule <ashwin.chaugule@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/cppc_acpi.c

index 2ed55161bca53e3bc9d7ae83616b4bbe4b79dcc3..3c083d2cc4342049a97fae02407fb64b7e553036 100644 (file)
@@ -524,7 +524,6 @@ int acpi_cppc_processor_probe(struct acpi_processor *pr)
        return 0;
 
 out_free:
-       cpc_ptr = per_cpu(cpc_desc_ptr, pr->id);
        kfree(cpc_ptr);
 
 out_buf_free: