mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-07 18:40:10 +00:00
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: 5ea7647b33 ("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>
This commit is contained in:
committed by
Len Brown
parent
15423b958f
commit
605736c692
@@ -2918,6 +2918,7 @@ int snapshot_cpu_lpi_us(void)
|
|||||||
if (retval != 1) {
|
if (retval != 1) {
|
||||||
fprintf(stderr, "Disabling Low Power Idle CPU output\n");
|
fprintf(stderr, "Disabling Low Power Idle CPU output\n");
|
||||||
BIC_NOT_PRESENT(BIC_CPU_LPI);
|
BIC_NOT_PRESENT(BIC_CPU_LPI);
|
||||||
|
fclose(fp);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user