linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tools/power turbostat: fix file descriptor leaks
@ 2019-04-08 16:12 Gustavo A. R. Silva
  2019-04-08 16:12 ` Gustavo A. R. Silva
  2019-04-08 17:04 ` Prarit Bhargava
  0 siblings, 2 replies; 11+ messages in thread
From: Gustavo A. R. Silva @ 2019-04-08 16:12 UTC (permalink / raw)
  To: Len Brown, Prarit Bhargava; +Cc: linux-pm, linux-kernel, 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 <gustavo@embeddedor.com>
---
 tools/power/x86/turbostat/turbostat.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c
index c7727be9719f..78d9acba8e9b 100644
--- a/tools/power/x86/turbostat/turbostat.c
+++ b/tools/power/x86/turbostat/turbostat.c
@@ -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);
-- 
2.21.0

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH] tools/power turbostat: fix file descriptor leaks
  2019-04-08 16:12 [PATCH] tools/power turbostat: fix file descriptor leaks Gustavo A. R. Silva
@ 2019-04-08 16:12 ` Gustavo A. R. Silva
  2019-04-08 17:04 ` Prarit Bhargava
  1 sibling, 0 replies; 11+ messages in thread
From: Gustavo A. R. Silva @ 2019-04-08 16:12 UTC (permalink / raw)
  To: Len Brown, Prarit Bhargava; +Cc: linux-pm, linux-kernel, 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 <gustavo@embeddedor.com>
---
 tools/power/x86/turbostat/turbostat.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c
index c7727be9719f..78d9acba8e9b 100644
--- a/tools/power/x86/turbostat/turbostat.c
+++ b/tools/power/x86/turbostat/turbostat.c
@@ -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);
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH] tools/power turbostat: fix file descriptor leaks
  2019-04-08 16:12 [PATCH] tools/power turbostat: fix file descriptor leaks Gustavo A. R. Silva
  2019-04-08 16:12 ` Gustavo A. R. Silva
@ 2019-04-08 17:04 ` Prarit Bhargava
  2019-04-08 17:04   ` Prarit Bhargava
  2019-04-22 15:15   ` Gustavo A. R. Silva
  1 sibling, 2 replies; 11+ messages in thread
From: Prarit Bhargava @ 2019-04-08 17:04 UTC (permalink / raw)
  To: Gustavo A. R. Silva, Len Brown; +Cc: linux-pm, linux-kernel



On 4/8/19 12:12 PM, Gustavo A. R. Silva wrote:
> 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 <gustavo@embeddedor.com>

Reviewed-by: Prarit Bhargava <prarit@redhat.com>

P.

> ---
>  tools/power/x86/turbostat/turbostat.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c
> index c7727be9719f..78d9acba8e9b 100644
> --- a/tools/power/x86/turbostat/turbostat.c
> +++ b/tools/power/x86/turbostat/turbostat.c
> @@ -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);
> 

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] tools/power turbostat: fix file descriptor leaks
  2019-04-08 17:04 ` Prarit Bhargava
@ 2019-04-08 17:04   ` Prarit Bhargava
  2019-04-22 15:15   ` Gustavo A. R. Silva
  1 sibling, 0 replies; 11+ messages in thread
From: Prarit Bhargava @ 2019-04-08 17:04 UTC (permalink / raw)
  To: Gustavo A. R. Silva, Len Brown; +Cc: linux-pm, linux-kernel



On 4/8/19 12:12 PM, Gustavo A. R. Silva wrote:
> 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 <gustavo@embeddedor.com>

Reviewed-by: Prarit Bhargava <prarit@redhat.com>

P.

> ---
>  tools/power/x86/turbostat/turbostat.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c
> index c7727be9719f..78d9acba8e9b 100644
> --- a/tools/power/x86/turbostat/turbostat.c
> +++ b/tools/power/x86/turbostat/turbostat.c
> @@ -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);
> 

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] tools/power turbostat: fix file descriptor leaks
  2019-04-08 17:04 ` Prarit Bhargava
  2019-04-08 17:04   ` Prarit Bhargava
@ 2019-04-22 15:15   ` Gustavo A. R. Silva
  2019-04-22 15:15     ` Gustavo A. R. Silva
  2019-04-23  8:23     ` Rafael J. Wysocki
  1 sibling, 2 replies; 11+ messages in thread
From: Gustavo A. R. Silva @ 2019-04-22 15:15 UTC (permalink / raw)
  To: Prarit Bhargava, Len Brown; +Cc: linux-pm, linux-kernel

Hi all,

Friendly ping:

Who can take this?

Thanks
--
Gustavo

On 4/8/19 12:04 PM, Prarit Bhargava wrote:
> 
> 
> On 4/8/19 12:12 PM, Gustavo A. R. Silva wrote:
>> 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 <gustavo@embeddedor.com>
> 
> Reviewed-by: Prarit Bhargava <prarit@redhat.com>
> 
> P.
> 
>> ---
>>  tools/power/x86/turbostat/turbostat.c | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c
>> index c7727be9719f..78d9acba8e9b 100644
>> --- a/tools/power/x86/turbostat/turbostat.c
>> +++ b/tools/power/x86/turbostat/turbostat.c
>> @@ -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);
>>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] tools/power turbostat: fix file descriptor leaks
  2019-04-22 15:15   ` Gustavo A. R. Silva
@ 2019-04-22 15:15     ` Gustavo A. R. Silva
  2019-04-23  8:23     ` Rafael J. Wysocki
  1 sibling, 0 replies; 11+ messages in thread
From: Gustavo A. R. Silva @ 2019-04-22 15:15 UTC (permalink / raw)
  To: Prarit Bhargava, Len Brown; +Cc: linux-pm, linux-kernel

Hi all,

Friendly ping:

Who can take this?

Thanks
--
Gustavo

On 4/8/19 12:04 PM, Prarit Bhargava wrote:
> 
> 
> On 4/8/19 12:12 PM, Gustavo A. R. Silva wrote:
>> 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 <gustavo@embeddedor.com>
> 
> Reviewed-by: Prarit Bhargava <prarit@redhat.com>
> 
> P.
> 
>> ---
>>  tools/power/x86/turbostat/turbostat.c | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c
>> index c7727be9719f..78d9acba8e9b 100644
>> --- a/tools/power/x86/turbostat/turbostat.c
>> +++ b/tools/power/x86/turbostat/turbostat.c
>> @@ -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);
>>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] tools/power turbostat: fix file descriptor leaks
  2019-04-22 15:15   ` Gustavo A. R. Silva
  2019-04-22 15:15     ` Gustavo A. R. Silva
@ 2019-04-23  8:23     ` Rafael J. Wysocki
  2019-04-23  8:23       ` Rafael J. Wysocki
  2019-08-26  4:03       ` Gustavo A. R. Silva
  1 sibling, 2 replies; 11+ messages in thread
From: Rafael J. Wysocki @ 2019-04-23  8:23 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: Prarit Bhargava, Len Brown, Linux PM, Linux Kernel Mailing List

On Mon, Apr 22, 2019 at 5:55 PM Gustavo A. R. Silva
<gustavo@embeddedor.com> wrote:
>
> 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!

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] tools/power turbostat: fix file descriptor leaks
  2019-04-23  8:23     ` Rafael J. Wysocki
@ 2019-04-23  8:23       ` Rafael J. Wysocki
  2019-08-26  4:03       ` Gustavo A. R. Silva
  1 sibling, 0 replies; 11+ messages in thread
From: Rafael J. Wysocki @ 2019-04-23  8:23 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: Prarit Bhargava, Len Brown, Linux PM, Linux Kernel Mailing List

On Mon, Apr 22, 2019 at 5:55 PM Gustavo A. R. Silva
<gustavo@embeddedor.com> wrote:
>
> 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!

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] tools/power turbostat: fix file descriptor leaks
  2019-04-23  8:23     ` Rafael J. Wysocki
  2019-04-23  8:23       ` Rafael J. Wysocki
@ 2019-08-26  4:03       ` Gustavo A. R. Silva
  2019-08-26  7:55         ` Rafael J. Wysocki
  1 sibling, 1 reply; 11+ messages in thread
From: Gustavo A. R. Silva @ 2019-08-26  4:03 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Prarit Bhargava, Len Brown, Linux PM, Linux Kernel Mailing List

Hi Rafael,

On 4/23/19 3:23 AM, Rafael J. Wysocki wrote:
> On Mon, Apr 22, 2019 at 5:55 PM Gustavo A. R. Silva
> <gustavo@embeddedor.com> wrote:
>>
>> 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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] tools/power turbostat: fix file descriptor leaks
  2019-08-26  4:03       ` Gustavo A. R. Silva
@ 2019-08-26  7:55         ` Rafael J. Wysocki
       [not found]           ` <841150bdcbd88a00a30a7ba86272918263959699.camel@gmail.com>
  0 siblings, 1 reply; 11+ messages in thread
From: Rafael J. Wysocki @ 2019-08-26  7:55 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: Rafael J. Wysocki, Prarit Bhargava, Len Brown, Linux PM,
	Linux Kernel Mailing List

On Mon, Aug 26, 2019 at 6:25 AM Gustavo A. R. Silva
<gustavo@embeddedor.com> wrote:
>
> Hi Rafael,
>
> On 4/23/19 3:23 AM, Rafael J. Wysocki wrote:
> > On Mon, Apr 22, 2019 at 5:55 PM Gustavo A. R. Silva
> > <gustavo@embeddedor.com> wrote:
> >>
> >> 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.

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!

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] tools/power turbostat: fix file descriptor leaks
       [not found]           ` <841150bdcbd88a00a30a7ba86272918263959699.camel@gmail.com>
@ 2019-08-26  8:13             ` Rafael J. Wysocki
  0 siblings, 0 replies; 11+ messages in thread
From: Rafael J. Wysocki @ 2019-08-26  8:13 UTC (permalink / raw)
  To: Artem Bityutskiy
  Cc: Rafael J. Wysocki, Gustavo A. R. Silva, Prarit Bhargava,
	Len Brown, Linux PM, Linux Kernel Mailing List

On Mon, Aug 26, 2019 at 10:02 AM Artem Bityutskiy <dedekind1@gmail.com> wrote:
>
> On Mon, 2019-08-26 at 09:55 +0200, Rafael J. Wysocki wrote:
>
> 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.
>
>
>
> 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!

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2019-08-26  8:13 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-08 16:12 [PATCH] tools/power turbostat: fix file descriptor leaks Gustavo A. R. Silva
2019-04-08 16:12 ` Gustavo A. R. Silva
2019-04-08 17:04 ` Prarit Bhargava
2019-04-08 17:04   ` Prarit Bhargava
2019-04-22 15:15   ` Gustavo A. R. Silva
2019-04-22 15:15     ` Gustavo A. R. Silva
2019-04-23  8:23     ` Rafael J. Wysocki
2019-04-23  8:23       ` Rafael J. Wysocki
2019-08-26  4:03       ` Gustavo A. R. Silva
2019-08-26  7:55         ` Rafael J. Wysocki
     [not found]           ` <841150bdcbd88a00a30a7ba86272918263959699.camel@gmail.com>
2019-08-26  8:13             ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).