power: fix double free of opened files

Fix double free of f_min and f_max by reverting the fclose() for f_min
and f_max. As f_min and f_max are stored for further use and closed in
uncore deinitialization.

Fixes: b127e74cce ("power: fix open file descriptors leak")

Signed-off-by: Tadhg Kearney <tadhg.kearney@intel.com>
Acked-by: Reshma Pattan <reshma.pattan@intel.com>
This commit is contained in:
Tadhg Kearney 2022-11-04 16:23:53 +00:00 committed by David Marchand
parent 58794bf8d2
commit 08aa805a0b

View File

@ -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;