]> git.baikalelectronics.ru Git - kernel.git/commit
tools/power turbostat: fix leak of file descriptor on error return path
authorColin Ian King <colin.king@canonical.com>
Mon, 8 Apr 2019 09:00:44 +0000 (10:00 +0100)
committerLen Brown <len.brown@intel.com>
Sat, 31 Aug 2019 18:48:34 +0000 (14:48 -0400)
commit8b8995c295998086c52a47b3663a20f74391b662
tree5ad0d282d9b81d88095b1c690313210da5436d8a
parentf215277735f9ac3528537ab8e510700b0a29863a
tools/power turbostat: fix leak of file descriptor on error return path

Currently the error return path does not close the file fp and leaks
a file descriptor. Fix this by closing the file.

Fixes: fdde20a7fc2d ("tools/power turbostat: Warn on bad ACPI LPIT data")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Len Brown <len.brown@intel.com>
tools/power/x86/turbostat/turbostat.c