X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Fpower%2Fpower_cppc_cpufreq.c;h=25185a791ca7e5784f8043945ebe0113d124b1d5;hb=09b0a36cc7aef21deec6a73d3930a5fd43dfaed9;hp=e92973ab54103ba5ac6e7de3dc6be7dd5314ca8b;hpb=ef1cc88f183702f523bf2701e1d3984a31b08ab4;p=dpdk.git diff --git a/lib/power/power_cppc_cpufreq.c b/lib/power/power_cppc_cpufreq.c index e92973ab54..25185a791c 100644 --- a/lib/power/power_cppc_cpufreq.c +++ b/lib/power/power_cppc_cpufreq.c @@ -246,6 +246,11 @@ power_get_available_freqs(struct cppc_power_info *pi) pi->nominal_perf * UNIT_DIFF : pi->nominal_perf; num_freqs = (nominal_perf - scaling_min_freq) / BUS_FREQ + 1 + pi->turbo_available; + if (num_freqs >= RTE_MAX_LCORE_FREQS) { + RTE_LOG(ERR, POWER, "Too many available frequencies: %d\n", + num_freqs); + goto out; + } /* Generate the freq bucket array. */ for (i = 0, pi->nb_freqs = 0; i < num_freqs; i++) { @@ -616,7 +621,7 @@ power_cppc_enable_turbo(unsigned int lcore_id) return -1; } - /* TODO: must set to max once enbling Turbo? Considering add condition: + /* TODO: must set to max once enabling Turbo? Considering add condition: * if ((pi->turbo_available) && (pi->curr_idx <= 1)) */ /* Max may have changed, so call to max function */