*/
#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
#include <fcntl.h>
-#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include <signal.h>
#include <limits.h>
#include <errno.h>
#include <inttypes.h>
#include <rte_memcpy.h>
-#include <rte_memory.h>
-#include <rte_string_fns.h>
#include "power_pstate_cpufreq.h"
#include "power_common.h"
*/
num_freqs = (base_max_freq - sys_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.
* If turbo is available the freq bucket[0] value is base_max +1
num_freqs, pi->lcore_id);
out:
- fclose(f_min);
- fclose(f_max);
+ if (f_min != NULL)
+ fclose(f_min);
+ if (f_max != NULL)
+ fclose(f_max);
return ret;
}