[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190919214822.548475916@linuxfoundation.org>
Date: Fri, 20 Sep 2019 00:03:04 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, Colin Ian King <colin.king@...onical.com>,
Len Brown <len.brown@...el.com>,
Sasha Levin <sashal@...nel.org>
Subject: [PATCH 5.2 096/124] tools/power turbostat: fix leak of file descriptor on error return path
From: Colin Ian King <colin.king@...onical.com>
[ Upstream commit 15423b958f33132152e209e98df0dedc7a78f22c ]
Currently the error return path does not close the file fp and leaks
a file descriptor. Fix this by closing the file.
Fixes: 5ea7647b333f ("tools/power turbostat: Warn on bad ACPI LPIT data")
Signed-off-by: Colin Ian King <colin.king@...onical.com>
Signed-off-by: Len Brown <len.brown@...el.com>
Signed-off-by: Sasha Levin <sashal@...nel.org>
---
tools/power/x86/turbostat/turbostat.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c
index 1cd28ebf8443b..efc8d07364c61 100644
--- a/tools/power/x86/turbostat/turbostat.c
+++ b/tools/power/x86/turbostat/turbostat.c
@@ -2938,6 +2938,7 @@ int snapshot_sys_lpi_us(void)
if (retval != 1) {
fprintf(stderr, "Disabling Low Power Idle System output\n");
BIC_NOT_PRESENT(BIC_SYS_LPI);
+ fclose(fp);
return -1;
}
fclose(fp);
--
2.20.1
Powered by blists - more mailing lists