New upstream version 18.11.2
[deb_dpdk.git] / lib / librte_power / power_acpi_cpufreq.c
index cd5978d..f7d3f9c 100644 (file)
@@ -12,8 +12,9 @@
 #include <signal.h>
 #include <limits.h>
 
-#include <rte_memcpy.h>
 #include <rte_atomic.h>
+#include <rte_memcpy.h>
+#include <rte_memory.h>
 
 #include "power_acpi_cpufreq.h"
 #include "power_common.h"
@@ -147,6 +148,8 @@ power_set_governor_userspace(struct rte_power_info *pi)
 
        s = fgets(buf, sizeof(buf), f);
        FOPS_OR_NULL_GOTO(s, out);
+       /* Strip off terminating '\n' */
+       strtok(buf, "\n");
 
        /* Check if current governor is userspace */
        if (strncmp(buf, POWER_GOVERNOR_USERSPACE,