power: fix resource leak by open file pointers
PATCH 1/1 power: fix resource leak by open file pointers
Close file pointers to Intel uncore sysfiles.
Coverity issue: 381400 381397
--- lib/power/rte_power_intel_uncore.c | 5 +++++ 1 file changed, 5 insertions(+)
lib/power/rte_power_intel_uncore.c +5 -0
@@ -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:
Signature · 1 line
2.25.1
Quoted 11 lines
-----Original Message-----
From: Kearney, Tadhg <[email protected]>
Sent: Wednesday, October 12, 2022 9:29 AM
To: [email protected]
Cc: Hunt, David <[email protected]>; Burakov, Anatoly <[email protected]>; Pattan, Reshma <[email protected]>; Kearney, Tadhg <[email protected]>
Subject: [PATCH] power: fix resource leak by open file pointers
Quoted 7 lines
Close file pointers to Intel uncore sysfiles.
Coverity issue: 381400 381397
Fixes 60b8a661a957 ("power: add Intel uncore frequency control")Signed-off-by Tadhg Kearney <[email protected]>
Thomas Monjalon
AppliedQuoted 9 lines
Quoted 7 lines
Close file pointers to Intel uncore sysfiles.
Coverity issue: 381400 381397
Fixes 60b8a661a957 ("power: add Intel uncore frequency control")Signed-off-by Tadhg Kearney <[email protected]>Reviewed-by Reshma Pattan <[email protected]>Acked-by Reshma Pattan <[email protected]>
Applied, thanks.
PATCH 1/1 power: fix double free of opened files
In reply to Tadhg KearneyFix 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.
--- lib/power/rte_power_intel_uncore.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
lib/power/rte_power_intel_uncore.c +1 -2
@@ -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 ;
Signature · 1 line
2.25.1
RE: [PATCH] power: fix double free of opened files
Quoted 4 lines
-----Original Message-----
From: Kearney, Tadhg <[email protected]>
<snip>
Quoted 10 lines
Subject: [PATCH] power: fix double free of opened files
Fix double free of
f_minandf_maxby reverting theflcose()forf_minandf_max. Asf_minandf_maxare stored for further use and closed in uncore deinitialization.Fixes b127e74 ("power: fix open file descriptors leak")Signed-off-by Tadhg Kearney <[email protected]>---
David Marchand
AppliedRe: [PATCH] power: fix double free of opened files
Quoted 5 lines · Reshma
Quoted 5 lines
Fix double free of
f_minandf_maxby reverting theflcose()forf_minandf_max. Asf_minandf_maxare 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'"
Quoted 5 lines
Quoted 3 lines
Signed-off-by Tadhg Kearney <[email protected]>---
Acked-by Reshma Pattan <[email protected]>
Applied, thanks.
Signature · 1 line
David Marchand