power: fix governor storage to trim newlines
[dpdk.git] / lib / librte_power / power_pstate_cpufreq.c
index 9c1a162..3e04e80 100644 (file)
@@ -292,6 +292,8 @@ power_set_governor_performance(struct pstate_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 performance */
        if (strncmp(buf, POWER_GOVERNOR_PERF,