diff mbox

CPPC: Fix potential ptr leak

Message ID 1445590972-12331-1-git-send-email-ashwin.chaugule@linaro.org (mailing list archive)
State Accepted, archived
Delegated to: Rafael Wysocki
Headers show

Commit Message

Ashwin Chaugule Oct. 23, 2015, 9:02 a.m. UTC
The patch 337aadff8e45: "ACPI: Introduce CPU performance controls
using CPPC" from Oct 2, 2015, leads to the following static checker
warning:

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

Fix warning by removing bogus per cpu ptr dereference.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Ashwin Chaugule <ashwin.chaugule@linaro.org>
---
 drivers/acpi/cppc_acpi.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Rafael J. Wysocki Oct. 28, 2015, 3:18 a.m. UTC | #1
On Friday, October 23, 2015 05:02:52 AM Ashwin Chaugule wrote:
> The patch 337aadff8e45: "ACPI: Introduce CPU performance controls
> using CPPC" from Oct 2, 2015, leads to the following static checker
> warning:
> 
>         drivers/acpi/cppc_acpi.c:527 acpi_cppc_processor_probe()
>         warn: overwrite may leak 'cpc_ptr'
> 
> Fix warning by removing bogus per cpu ptr dereference.
> 
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Signed-off-by: Ashwin Chaugule <ashwin.chaugule@linaro.org>
> ---
>  drivers/acpi/cppc_acpi.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c
> index 0bbf84b..8ca4c2c 100644
> --- a/drivers/acpi/cppc_acpi.c
> +++ b/drivers/acpi/cppc_acpi.c
> @@ -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:

Applied, thanks!

Rafael

--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c
index 0bbf84b..8ca4c2c 100644
--- a/drivers/acpi/cppc_acpi.c
+++ b/drivers/acpi/cppc_acpi.c
@@ -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: