DPDK patches and discussions
 help / color / mirror / Atom feed
From: Tadhg Kearney <tadhg.kearney@intel.com>
To: dev@dpdk.org
Cc: david.hunt@intel.com, anatoly.burakov@intel.com,
	reshma.pattan@intel.com, Tadhg Kearney <tadhg.kearney@intel.com>
Subject: [PATCH] power: fix resource leak by open file pointers
Date: Wed, 12 Oct 2022 08:29:28 +0000	[thread overview]
Message-ID: <20221012082928.2171562-1-tadhg.kearney@intel.com> (raw)

Close file pointers to Intel uncore sysfiles.

Coverity issue: 381400 381397
Fixes: 60b8a661a957 ("power: add Intel uncore frequency control")
CC: david.hunt@intel.com

Signed-off-by: Tadhg Kearney <tadhg.kearney@intel.com>
---
 lib/power/rte_power_intel_uncore.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lib/power/rte_power_intel_uncore.c b/lib/power/rte_power_intel_uncore.c
index 3afe8feffa..f86e1c8b7a 100644
--- a/lib/power/rte_power_intel_uncore.c
+++ b/lib/power/rte_power_intel_uncore.c
@@ -192,6 +192,11 @@ power_init_for_setting_uncore_freq(struct uncore_power_info *ui)
 	ui->init_max_freq = base_max_freq;
 	ui->init_min_freq = base_min_freq;
 
+	fclose(f_base_min);
+	fclose(f_base_max);
+	fclose(f_max);
+	fclose(f_min);
+
 	return 0;
 
 err:
-- 
2.25.1


             reply	other threads:[~2022-10-12  8:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-12  8:29 Tadhg Kearney [this message]
2022-10-17  8:37 ` Pattan, Reshma
2022-10-26 21:30   ` Thomas Monjalon
2022-11-04 16:23 ` [PATCH] power: fix double free of opened files Tadhg Kearney
2022-11-07  9:17   ` Pattan, Reshma
2022-11-14 10:00     ` David Marchand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221012082928.2171562-1-tadhg.kearney@intel.com \
    --to=tadhg.kearney@intel.com \
    --cc=anatoly.burakov@intel.com \
    --cc=david.hunt@intel.com \
    --cc=dev@dpdk.org \
    --cc=reshma.pattan@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).