linux-stable/tools/power
Colin Ian King 5e5fd36c58 tools/power turbostat: Fix file pointer leak
Currently if a fscanf fails then an early return leaks an open
file pointer. Fix this by fclosing the file before the return.
Detected using static analysis with cppcheck:

tools/power/x86/turbostat/turbostat.c:2039:3: error: Resource leak: fp [resourceLeak]

Fixes: eae97e053f ("tools/power turbostat: Support thermal throttle count print")
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Acked-by: Chen Yu <yu.c.chen@intel.com>
Reviewed-by: Tom Rix <trix@redhat.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2022-07-28 14:23:25 -04:00
..
acpi ACPICA: Update copyright notices to the year 2022 2022-04-13 20:24:57 +02:00
cpupower cpupower: Add "perf" option to print AMD P-State information 2022-02-23 17:46:21 -07:00
pm-graph pm-graph: Fix typo "accesible" 2021-03-22 15:27:17 +01:00
x86 tools/power turbostat: Fix file pointer leak 2022-07-28 14:23:25 -04:00