linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* re: ACPI: Introduce CPU performance controls using CPPC
@ 2015-10-22 19:49 Dan Carpenter
  2015-10-23  8:42 ` Ashwin Chaugule
  2015-10-23  9:02 ` [PATCH] CPPC: Fix potential ptr leak Ashwin Chaugule
  0 siblings, 2 replies; 6+ messages in thread
From: Dan Carpenter @ 2015-10-22 19:49 UTC (permalink / raw)
  To: ashwin.chaugule; +Cc: linux-acpi

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-10-28  2:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [PATCH] CPPC: Fix potential ptr leak Ashwin Chaugule
2015-10-28  3:18   ` Rafael J. Wysocki

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).