From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id F2712A0096 for ; Mon, 8 Apr 2019 17:21:35 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 71D082C54; Mon, 8 Apr 2019 17:21:34 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id AC2142C24 for ; Mon, 8 Apr 2019 17:21:32 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Apr 2019 08:21:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,325,1549958400"; d="scan'208";a="141023752" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga007.fm.intel.com with ESMTP; 08 Apr 2019 08:21:30 -0700 Received: from sivswdev09.ir.intel.com (sivswdev09.ir.intel.com [10.237.217.48]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id x38FLUTL007731; Mon, 8 Apr 2019 16:21:30 +0100 Received: from sivswdev09.ir.intel.com (localhost [127.0.0.1]) by sivswdev09.ir.intel.com with ESMTP id x38FLTVL012276; Mon, 8 Apr 2019 16:21:29 +0100 Received: (from lma25@localhost) by sivswdev09.ir.intel.com with LOCAL id x38FLTVX012272; Mon, 8 Apr 2019 16:21:29 +0100 From: Liang Ma To: dev@dpdk.org Cc: david.hunt@intel.com, anatoly.burakov@intel.com, Liang Ma Date: Mon, 8 Apr 2019 16:21:24 +0100 Message-Id: <1554736884-12195-1-git-send-email-liang.j.ma@intel.com> X-Mailer: git-send-email 1.7.7.4 Subject: [dpdk-dev] [PATCH] power: fix coverity issue X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Content-Type: text/plain; charset="UTF-8" Message-ID: <20190408152124.diIusv5d5oELFWgf7daQTzfPHXKFKAyg9tzjTlOYMts@z> Coverity issue: 337668 Fixes: b60fd5f8b1ce8f0a2c ("power: add bit for high frequency cores") Signed-off-by: Liang Ma --- 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