tools/power x86_energy_perf_policy: Fix file leak in get_pkg_num()
authorSamasth Norway Ananda <samasth.norway.ananda@oracle.com>
Wed, 14 Feb 2024 00:19:56 +0000 (16:19 -0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 22 Feb 2024 19:05:28 +0000 (20:05 +0100)
commitf85450f134f0b4ca7e042dc3dc89155656a2299d
tree4c64a21aa2163441c8b84f4b68ad2c8d35871e27
parentb401b621758e46812da61fa58a67c3fd8d91de0d
tools/power x86_energy_perf_policy: Fix file leak in get_pkg_num()

In function get_pkg_num() if fopen_or_die() succeeds it returns a file
pointer to be used. But fclose() is never called before returning from
the function.

Signed-off-by: Samasth Norway Ananda <samasth.norway.ananda@oracle.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
tools/power/x86/x86_energy_perf_policy/x86_energy_perf_policy.c