linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ashwin Chaugule <ashwin.chaugule@linaro.org>
To: rafael@kernel.org, dan.carpenter@oracle.com
Cc: linux-acpi@vger.kernel.org, Ashwin Chaugule <ashwin.chaugule@linaro.org>
Subject: [PATCH] CPPC: Fix potential ptr leak
Date: Fri, 23 Oct 2015 05:02:52 -0400	[thread overview]
Message-ID: <1445590972-12331-1-git-send-email-ashwin.chaugule@linaro.org> (raw)
In-Reply-To: <20151022194928.GA24403@mwanda>

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:
-- 
1.9.1


  parent reply	other threads:[~2015-10-23  9:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-22 19:49 ACPI: Introduce CPU performance controls using CPPC Dan Carpenter
2015-10-23  8:42 ` Ashwin Chaugule
2015-10-23  8:52   ` Dan Carpenter
2015-10-23  8:55     ` Ashwin Chaugule
2015-10-23  9:02 ` Ashwin Chaugule [this message]
2015-10-28  3:18   ` [PATCH] CPPC: Fix potential ptr leak Rafael J. Wysocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1445590972-12331-1-git-send-email-ashwin.chaugule@linaro.org \
    --to=ashwin.chaugule@linaro.org \
    --cc=dan.carpenter@oracle.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=rafael@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).