power: fix double free of opened files
Checks
Commit Message
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(-)
Comments
> -----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>
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.
@@ -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;