* [PATCH] power: fix resource leak by open file pointers
@ 2022-10-12 8:29 Tadhg Kearney
2022-10-17 8:37 ` Pattan, Reshma
2022-11-04 16:23 ` [PATCH] power: fix double free of opened files Tadhg Kearney
0 siblings, 2 replies; 6+ messages in thread
From: Tadhg Kearney @ 2022-10-12 8:29 UTC (permalink / raw)
To: dev; +Cc: david.hunt, anatoly.burakov, reshma.pattan, Tadhg Kearney
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [PATCH] power: fix resource leak by open file pointers
2022-10-12 8:29 [PATCH] power: fix resource leak by open file pointers Tadhg Kearney
@ 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
1 sibling, 1 reply; 6+ messages in thread
From: Pattan, Reshma @ 2022-10-17 8:37 UTC (permalink / raw)
To: Kearney, Tadhg, dev; +Cc: Hunt, David, Burakov, Anatoly
> -----Original Message-----
> From: Kearney, Tadhg <tadhg.kearney@intel.com>
> Sent: Wednesday, October 12, 2022 9:29 AM
> To: dev@dpdk.org
> Cc: Hunt, David <david.hunt@intel.com>; Burakov, Anatoly
> <anatoly.burakov@intel.com>; Pattan, Reshma
> <reshma.pattan@intel.com>; Kearney, Tadhg <tadhg.kearney@intel.com>
> Subject: [PATCH] power: fix resource leak by open file pointers
>
> 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>
Reviewed-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: Reshma Pattan <reshma.pattan@intel.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] power: fix resource leak by open file pointers
2022-10-17 8:37 ` Pattan, Reshma
@ 2022-10-26 21:30 ` Thomas Monjalon
0 siblings, 0 replies; 6+ messages in thread
From: Thomas Monjalon @ 2022-10-26 21:30 UTC (permalink / raw)
To: Kearney, Tadhg; +Cc: dev, Hunt, David, Burakov, Anatoly, Pattan, Reshma
> > 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>
> Reviewed-by: Reshma Pattan <reshma.pattan@intel.com>
> Acked-by: Reshma Pattan <reshma.pattan@intel.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] power: fix double free of opened files
2022-10-12 8:29 [PATCH] power: fix resource leak by open file pointers Tadhg Kearney
2022-10-17 8:37 ` Pattan, Reshma
@ 2022-11-04 16:23 ` Tadhg Kearney
2022-11-07 9:17 ` Pattan, Reshma
1 sibling, 1 reply; 6+ messages in thread
From: Tadhg Kearney @ 2022-11-04 16:23 UTC (permalink / raw)
To: dev
Cc: david.hunt, anatoly.burakov, reshma.pattan, chris.macnamara,
Tadhg Kearney
Fix double free of f_min and f_max by reverting the flcose() for f_min
and f_max. As f_min and f_max are stored for further use and closed in
uncore deinitialization.
Fixes: b127e74 ("power: fix open file descriptors leak")
Signed-off-by: Tadhg Kearney <tadhg.kearney@intel.com>
---
lib/power/rte_power_intel_uncore.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/lib/power/rte_power_intel_uncore.c b/lib/power/rte_power_intel_uncore.c
index f86e1c8b7a..3b8724385f 100644
--- a/lib/power/rte_power_intel_uncore.c
+++ b/lib/power/rte_power_intel_uncore.c
@@ -194,8 +194,7 @@ power_init_for_setting_uncore_freq(struct uncore_power_info *ui)
fclose(f_base_min);
fclose(f_base_max);
- fclose(f_max);
- fclose(f_min);
+ /* f_min and f_max are stored, no need to close */
return 0;
--
2.25.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [PATCH] power: fix double free of opened files
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
0 siblings, 1 reply; 6+ messages in thread
From: Pattan, Reshma @ 2022-11-07 9:17 UTC (permalink / raw)
To: Kearney, Tadhg, dev; +Cc: Hunt, David, Burakov, Anatoly, Macnamara, Chris
> -----Original Message-----
> From: Kearney, Tadhg <tadhg.kearney@intel.com>
<snip>
> Subject: [PATCH] power: fix double free of opened files
>
> Fix double free of f_min and f_max by reverting the flcose() for f_min and
> f_max. As f_min and f_max are stored for further use and closed in uncore
> deinitialization.
>
> Fixes: b127e74 ("power: fix open file descriptors leak")
>
> Signed-off-by: Tadhg Kearney <tadhg.kearney@intel.com>
> ---
Acked-by: Reshma Pattan <reshma.pattan@intel.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] power: fix double free of opened files
2022-11-07 9:17 ` Pattan, Reshma
@ 2022-11-14 10:00 ` David Marchand
0 siblings, 0 replies; 6+ messages in thread
From: David Marchand @ 2022-11-14 10:00 UTC (permalink / raw)
To: Pattan, Reshma, Kearney, Tadhg
Cc: dev, Hunt, David, Burakov, Anatoly, Macnamara, Chris
On Mon, Nov 7, 2022 at 10:18 AM Pattan, Reshma <reshma.pattan@intel.com> wrote:
> > Fix double free of f_min and f_max by reverting the flcose() for f_min and
> > f_max. As f_min and f_max are stored for further use and closed in uncore
> > deinitialization.
> >
> > Fixes: b127e74 ("power: fix open file descriptors leak")
Please, use 12 chars format for commit hash, as documented.
git config alias.fixline "log -1 --abbrev=12 --format='Fixes: %h
(\"%s\")%nCc: %ae'"
> >
> > Signed-off-by: Tadhg Kearney <tadhg.kearney@intel.com>
> > ---
>
> Acked-by: Reshma Pattan <reshma.pattan@intel.com>
Applied, thanks.
--
David Marchand
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2022-11-14 10:00 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-12 8:29 [PATCH] power: fix resource leak by open file pointers Tadhg Kearney
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
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).