All of lore.kernel.org
 help / color / mirror / Atom feed
From: <dan.carpenter@oracle.com>
To: kernel-janitors@vger.kernel.org
Subject: [bug report] cpufreq: intel_pstate: Allow raw energy performance preference value
Date: Wed, 08 Jul 2020 11:44:53 +0000	[thread overview]
Message-ID: <20200708114453.GA11282@mwanda> (raw)

Hello Srinivas Pandruvada,

The patch f473bf398bf1: "cpufreq: intel_pstate: Allow raw energy
performance preference value" from Jun 26, 2020, leads to the
following static checker warning:

	drivers/cpufreq/intel_pstate.c:731 store_energy_performance_preference()
	error: uninitialized symbol 'epp'.

drivers/cpufreq/intel_pstate.c
   706  static ssize_t store_energy_performance_preference(
   707                  struct cpufreq_policy *policy, const char *buf, size_t count)
   708  {
   709          struct cpudata *cpu_data = all_cpu_data[policy->cpu];
   710          char str_preference[21];
   711          bool raw = false;
   712          u32 epp;
                    ^^^
   713          int ret;
   714  
   715          ret = sscanf(buf, "%20s", str_preference);
   716          if (ret != 1)
   717                  return -EINVAL;
   718  
   719          ret = match_string(energy_perf_strings, -1, str_preference);
   720          if (ret < 0) {
   721                  if (!boot_cpu_has(X86_FEATURE_HWP_EPP))
   722                          return ret;
   723  
   724                  ret = kstrtouint(buf, 10, &epp);
                                                  ^^^^

   725                  if (ret)
   726                          return ret;
   727  
   728                  raw = true;
   729          }
   730  
   731          ret = intel_pstate_set_energy_pref_index(cpu_data, ret, raw, epp);
                                                                             ^^^
This will cause a KASan warning at runtime as well as a static checker
warning.

   732          if (ret)
   733                  return ret;
   734  
   735          return count;
   736  }

regards,
dan carpenter

                 reply	other threads:[~2020-07-08 11:44 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20200708114453.GA11282@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=kernel-janitors@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.