mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-06 22:58:29 +00:00
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: 5ea7647b33
("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>
This commit is contained in:
parent
d4794f25f1
commit
15423b958f
1 changed files with 1 additions and 0 deletions
|
@ -2944,6 +2944,7 @@ int snapshot_sys_lpi_us(void)
|
||||||
if (retval != 1) {
|
if (retval != 1) {
|
||||||
fprintf(stderr, "Disabling Low Power Idle System output\n");
|
fprintf(stderr, "Disabling Low Power Idle System output\n");
|
||||||
BIC_NOT_PRESENT(BIC_SYS_LPI);
|
BIC_NOT_PRESENT(BIC_SYS_LPI);
|
||||||
|
fclose(fp);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
|
|
Loading…
Add table
Reference in a new issue