Skip to content

Commit 0a1ba2c

Browse files
Colin Ian Kinggregkh
authored andcommitted
tools/power turbostat: fix leak of file descriptor on error return path
[ Upstream commit 15423b9 ] Currently the error return path does not close the file fp and leaks a file descriptor. Fix this by closing the file. Fixes: 5ea7647 ("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> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent caab8b8 commit 0a1ba2c

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎tools/power/x86/turbostat/turbostat.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2938,6 +2938,7 @@ int snapshot_sys_lpi_us(void)
29382938
if (retval != 1) {
29392939
fprintf(stderr, "Disabling Low Power Idle System output\n");
29402940
BIC_NOT_PRESENT(BIC_SYS_LPI);
2941+
fclose(fp);
29412942
return -1;
29422943
}
29432944
fclose(fp);

0 commit comments

Comments
 (0)