tools/power turbostat: fix file descriptor leaks
authorGustavo A. R. Silva <gustavo@embeddedor.com>
Mon, 8 Apr 2019 16:12:40 +0000 (11:12 -0500)
committerLen Brown <len.brown@intel.com>
Sat, 31 Aug 2019 18:48:34 +0000 (14:48 -0400)
commit605736c6929d541c78a85dffae4d33a23b6b2149
tree17983d66f5769f1d588c772a9ad6e8ea02b8042e
parent15423b958f33132152e209e98df0dedc7a78f22c
tools/power turbostat: fix file descriptor leaks

Fix file descriptor leaks by closing fp before return.

Addresses-Coverity-ID: 1444591 ("Resource leak")
Addresses-Coverity-ID: 1444592 ("Resource leak")
Fixes: 5ea7647b333f ("tools/power turbostat: Warn on bad ACPI LPIT data")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Reviewed-by: Prarit Bhargava <prarit@redhat.com>
Signed-off-by: Len Brown <len.brown@intel.com>
tools/power/x86/turbostat/turbostat.c