linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: ashwin.chaugule@linaro.org
Cc: linux-acpi@vger.kernel.org
Subject: re: ACPI: Introduce CPU performance controls using CPPC
Date: Thu, 22 Oct 2015 22:49:28 +0300	[thread overview]
Message-ID: <20151022194928.GA24403@mwanda> (raw)

Hello Ashwin Chaugule,

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'

drivers/acpi/cppc_acpi.c
   426          cpc_ptr = kzalloc(sizeof(struct cpc_desc), GFP_KERNEL);
   427          if (!cpc_ptr) {
   428                  ret = -ENOMEM;
   429                  goto out_buf_free;
   430          }
   431  
   432          /* First entry is NumEntries. */
   433          cpc_obj = &out_obj->package.elements[0];
   434          if (cpc_obj->type == ACPI_TYPE_INTEGER) {
   435                  num_ent = cpc_obj->integer.value;
   436          } else {
   437                  pr_debug("Unexpected entry type(%d) for NumEntries\n",
   438                                  cpc_obj->type);
   439                  goto out_free;
   440          }

[ snip ]

   523          kfree(output.pointer);
   524          return 0;
   525  
   526  out_free:
   527          cpc_ptr = per_cpu(cpc_desc_ptr, pr->id);

Why do we have this line?  Maybe it is left over and should be deleted?

   528          kfree(cpc_ptr);
   529  
   530  out_buf_free:
   531          kfree(output.pointer);
   532          return ret;
   533  }

regards,
dan carpenter

             reply	other threads:[~2015-10-22 19:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-22 19:49 Dan Carpenter [this message]
2015-10-23  8:42 ` ACPI: Introduce CPU performance controls using CPPC Ashwin Chaugule
2015-10-23  8:52   ` Dan Carpenter
2015-10-23  8:55     ` Ashwin Chaugule
2015-10-23  9:02 ` [PATCH] CPPC: Fix potential ptr leak Ashwin Chaugule
2015-10-28  3:18   ` 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=20151022194928.GA24403@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=ashwin.chaugule@linaro.org \
    --cc=linux-acpi@vger.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).