* [bug report] cpufreq: intel_pstate: Allow raw energy performance preference value
@ 2020-07-08 11:44 dan.carpenter
0 siblings, 0 replies; only message in thread
From: dan.carpenter @ 2020-07-08 11:44 UTC (permalink / raw)
To: kernel-janitors
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-07-08 11:44 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-08 11:44 [bug report] cpufreq: intel_pstate: Allow raw energy performance preference value dan.carpenter
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).