提交 15423b95 编写于 作者: C Colin Ian King 提交者: Len Brown

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: 5ea7647b ("tools/power turbostat: Warn on bad ACPI LPIT data")
Signed-off-by: NColin Ian King <colin.king@canonical.com>
Signed-off-by: NLen Brown <len.brown@intel.com>
上级 d4794f25
......@@ -2944,6 +2944,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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册