Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 605736c6 authored by Gustavo A. R. Silva's avatar Gustavo A. R. Silva Committed by Len Brown
Browse files

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: 5ea7647b ("tools/power turbostat: Warn on bad ACPI LPIT data")
Signed-off-by: default avatarGustavo A. R. Silva <gustavo@embeddedor.com>
Reviewed-by: default avatarPrarit Bhargava <prarit@redhat.com>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent 15423b95
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -2918,6 +2918,7 @@ int snapshot_cpu_lpi_us(void)
	if (retval != 1) {
		fprintf(stderr, "Disabling Low Power Idle CPU output\n");
		BIC_NOT_PRESENT(BIC_CPU_LPI);
		fclose(fp);
		return -1;
	}