[dpdk-dev] [PATCH] power: fix coverity issue

Liang Ma liang.j.ma at intel.com
Mon Apr 8 17:21:24 CEST 2019


Coverity issue: 337668

Fixes: b60fd5f8b1ce8f0a2c ("power: add bit for high frequency cores")

Signed-off-by: Liang Ma <liang.j.ma at intel.com>
---
 lib/librte_power/power_pstate_cpufreq.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/librte_power/power_pstate_cpufreq.c b/lib/librte_power/power_pstate_cpufreq.c
index 336c13869..db2f7a0f4 100644
--- a/lib/librte_power/power_pstate_cpufreq.c
+++ b/lib/librte_power/power_pstate_cpufreq.c
@@ -197,6 +197,9 @@ power_init_for_setting_freq(struct pstate_power_info *pi)
 				/ BUS_FREQ;
 	}
 
+	if (f_base != NULL)
+		fclose(f_base);
+
 	/* Add MSR read to detect turbo status */
 
 	if (power_rdmsr(PLATFORM_INFO, &max_non_turbo, pi->lcore_id) < 0)
-- 
2.17.2



More information about the dev mailing list