tools/power turbostat: fix file descriptor leaks
PATCH 1/1 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")
--- tools/power/x86/turbostat/turbostat.c | 2 ++ 1 file changed, 2 insertions(+)
tools/power/x86/turbostat/turbostat.c +2 -0
@@ -2924,6 +2924,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 ; }
@@ -2950,6 +2951,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);
Signature · 1 line
2.21.0
Quoted 6 lines · Gustavo A. R. Silva
Fix file descriptor leaks by closing fp before return.
Addresses-Coverity-ID: 1444591 ("Resource leak")
Addresses-Coverity-ID: 1444592 ("Resource leak")Fixes 5ea7647b333f ("tools/power turbostat: Warn on bad ACPI LPIT data")Signed-off-by Gustavo A. R. Silva <[email protected]>
P.
Quoted 25 lines
--- tools/power/x86/turbostat/turbostat.c | 2 ++ 1 file changed, 2 insertions(+)tools/power/x86/turbostat/turbostat.c +2
-0@@ -2924,6 +2924,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 ; }@@ -2950,6 +2951,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);
Hi all,
Friendly ping:
Who can take this?
Thanks
--
Gustavo
Quoted 39 lines · Prarit Bhargava
Quoted 6 lines · Gustavo A. R. Silva
Fix file descriptor leaks by closing fp before return.
Addresses-Coverity-ID: 1444591 ("Resource leak")
Addresses-Coverity-ID: 1444592 ("Resource leak")Fixes 5ea7647b333f ("tools/power turbostat: Warn on bad ACPI LPIT data")Signed-off-by Gustavo A. R. Silva <[email protected]>Reviewed-by Prarit Bhargava <[email protected]>P.
Quoted 25 lines
--- tools/power/x86/turbostat/turbostat.c | 2 ++ 1 file changed, 2 insertions(+)tools/power/x86/turbostat/turbostat.c +2
-0@@ -2924,6 +2924,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 ; }@@ -2950,6 +2951,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);
Quoted 6 lines · Gustavo A. R. Silva
Hi all,
Friendly ping:
Who can take this?
I've been waiting for Len to comment on this, let me talk to him offlist.
Thanks!
Hi Rafael,
Quoted 11 lines · Rafael J. Wysocki
Quoted 6 lines · Gustavo A. R. Silva
Hi all,
Friendly ping:
Who can take this?
I've been waiting for Len to comment on this, let me talk to him offlist.
I just noticed this hasn't been applied.
I wonder if you plan to apply it.
Thanks
--
Gustavo
Quoted 11 lines · Gustavo A. R. Silva
Hi Rafael,
Quoted 7 lines · Rafael J. Wysocki
Quoted 5 lines · Gustavo A. R. Silva
Hi all,
Friendly ping:
Quoted 8 lines
Quoted 4 lines
Quoted 1 line
Who can take this?
I've been waiting for Len to comment on this, let me talk to him offlist.
I just noticed this hasn't been applied.
I wonder if you plan to apply it.
Technically, Len Brown is the turbostat maintainer and I have been waiting for him to review the patch at least. Let me talk to Len.
Thanks!
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 5 lines · Artem Bityutskiy
On Mon, 2019-08-26 at 09:55 +0200, Rafael J. Wysocki wrote:
Technically, Len Brown is the turbostat maintainer and I have been
Quoted 8 lines
waiting for him to review the patch at least. Let me talk to Len.
Hi Rafael,
I also sent a couple of turbostat patches waiting for being acted upon, may be you could include them to the conversation too?
Yes, I will, thanks!