linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] bfp tools: Couple Coverity fixes
@ 2016-04-25  2:34 Florian Fainelli
  2016-04-25  2:34 ` [PATCH 1/2] bfp tools: Remove expression with no effect Florian Fainelli
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Florian Fainelli @ 2016-04-25  2:34 UTC (permalink / raw)
  To: linux-kernel; +Cc: ast, jolsa, acme, wangnan0, Florian Fainelli

Hi all,

Two trivial patches that were flagged by Coverity.

Thanks!

Florian Fainelli (2):
  bfp tools: Remove expression with no effect
  bfp tools: Fix syscall argument

 tools/build/feature/test-bpf.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

-- 
2.7.4

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

* [PATCH 1/2] bfp tools: Remove expression with no effect
  2016-04-25  2:34 [PATCH 0/2] bfp tools: Couple Coverity fixes Florian Fainelli
@ 2016-04-25  2:34 ` Florian Fainelli
  2016-04-27  3:11   ` Wangnan (F)
  2016-05-01  7:36   ` [tip:perf/core] bpf " tip-bot for Florian Fainelli
  2016-04-25  2:34 ` [PATCH 2/2] bfp tools: Fix syscall argument Florian Fainelli
  2016-04-27  2:46 ` [PATCH 0/2] bfp tools: Couple Coverity fixes Florian Fainelli
  2 siblings, 2 replies; 13+ messages in thread
From: Florian Fainelli @ 2016-04-25  2:34 UTC (permalink / raw)
  To: linux-kernel; +Cc: ast, jolsa, acme, wangnan0, Florian Fainelli

Assigning "attr" to "attr" does not have any effect, but was caught by
Coverity, so let's remove this.

Reported-by: coverity (CID 1354720)
Fixes: 1b76c13e4b36 ("bpf tools: Introduce 'bpf' library and add bpf feature check")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 tools/build/feature/test-bpf.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/tools/build/feature/test-bpf.c b/tools/build/feature/test-bpf.c
index b389026839b9..8236df9a46ca 100644
--- a/tools/build/feature/test-bpf.c
+++ b/tools/build/feature/test-bpf.c
@@ -27,7 +27,6 @@ int main(void)
 	attr.log_level = 0;
 	attr.kern_version = 0;
 
-	attr = attr;
 	/*
 	 * Test existence of __NR_bpf and BPF_PROG_LOAD.
 	 * This call should fail if we run the testcase.
-- 
2.7.4

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

* [PATCH 2/2] bfp tools: Fix syscall argument
  2016-04-25  2:34 [PATCH 0/2] bfp tools: Couple Coverity fixes Florian Fainelli
  2016-04-25  2:34 ` [PATCH 1/2] bfp tools: Remove expression with no effect Florian Fainelli
@ 2016-04-25  2:34 ` Florian Fainelli
  2016-04-27  3:01   ` Wangnan (F)
  2016-05-01  7:37   ` [tip:perf/core] bpf " tip-bot for Florian Fainelli
  2016-04-27  2:46 ` [PATCH 0/2] bfp tools: Couple Coverity fixes Florian Fainelli
  2 siblings, 2 replies; 13+ messages in thread
From: Florian Fainelli @ 2016-04-25  2:34 UTC (permalink / raw)
  To: linux-kernel; +Cc: ast, jolsa, acme, wangnan0, Florian Fainelli

Coverity flagged this under CID 1354884 as a sizeof mismatch, it turns
out that the argument "attr" passed to syscall should have been a
pointer to attr in the first place.

Reported-by: coverity (CID 1354884)
Fixes: 8f9e05fb298f ("perf tools: Fix PowerPC native building")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 tools/build/feature/test-bpf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/build/feature/test-bpf.c b/tools/build/feature/test-bpf.c
index 8236df9a46ca..e04ab89a1013 100644
--- a/tools/build/feature/test-bpf.c
+++ b/tools/build/feature/test-bpf.c
@@ -31,5 +31,5 @@ int main(void)
 	 * Test existence of __NR_bpf and BPF_PROG_LOAD.
 	 * This call should fail if we run the testcase.
 	 */
-	return syscall(__NR_bpf, BPF_PROG_LOAD, attr, sizeof(attr));
+	return syscall(__NR_bpf, BPF_PROG_LOAD, &attr, sizeof(attr));
 }
-- 
2.7.4

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

* Re: [PATCH 0/2] bfp tools: Couple Coverity fixes
  2016-04-25  2:34 [PATCH 0/2] bfp tools: Couple Coverity fixes Florian Fainelli
  2016-04-25  2:34 ` [PATCH 1/2] bfp tools: Remove expression with no effect Florian Fainelli
  2016-04-25  2:34 ` [PATCH 2/2] bfp tools: Fix syscall argument Florian Fainelli
@ 2016-04-27  2:46 ` Florian Fainelli
  2016-04-27  3:00   ` Wangnan (F)
  2 siblings, 1 reply; 13+ messages in thread
From: Florian Fainelli @ 2016-04-27  2:46 UTC (permalink / raw)
  To: linux-kernel; +Cc: ast, jolsa, acme, wangnan0

Le 24/04/2016 19:34, Florian Fainelli a écrit :
> Hi all,
> 
> Two trivial patches that were flagged by Coverity.
> 
> Thanks!

Ping! Did I send this to the correct mailing-list?
-- 
Florian

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

* Re: [PATCH 0/2] bfp tools: Couple Coverity fixes
  2016-04-27  2:46 ` [PATCH 0/2] bfp tools: Couple Coverity fixes Florian Fainelli
@ 2016-04-27  3:00   ` Wangnan (F)
  2016-04-27  3:08     ` Alexei Starovoitov
  0 siblings, 1 reply; 13+ messages in thread
From: Wangnan (F) @ 2016-04-27  3:00 UTC (permalink / raw)
  To: Florian Fainelli, linux-kernel; +Cc: ast, jolsa, acme



On 2016/4/27 10:46, Florian Fainelli wrote:
> Le 24/04/2016 19:34, Florian Fainelli a écrit :
>> Hi all,
>>
>> Two trivial patches that were flagged by Coverity.
>>
>> Thanks!
> Ping! Did I send this to the correct mailing-list?

Sorry for the late. You are on the right list :)

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

* Re: [PATCH 2/2] bfp tools: Fix syscall argument
  2016-04-25  2:34 ` [PATCH 2/2] bfp tools: Fix syscall argument Florian Fainelli
@ 2016-04-27  3:01   ` Wangnan (F)
  2016-04-27 14:34     ` Arnaldo Carvalho de Melo
  2016-05-01  7:37   ` [tip:perf/core] bpf " tip-bot for Florian Fainelli
  1 sibling, 1 reply; 13+ messages in thread
From: Wangnan (F) @ 2016-04-27  3:01 UTC (permalink / raw)
  To: Florian Fainelli, linux-kernel, acme; +Cc: ast, jolsa



On 2016/4/25 10:34, Florian Fainelli wrote:
> Coverity flagged this under CID 1354884 as a sizeof mismatch, it turns
> out that the argument "attr" passed to syscall should have been a
> pointer to attr in the first place.
>
> Reported-by: coverity (CID 1354884)
> Fixes: 8f9e05fb298f ("perf tools: Fix PowerPC native building")
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> ---
>   tools/build/feature/test-bpf.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/build/feature/test-bpf.c b/tools/build/feature/test-bpf.c
> index 8236df9a46ca..e04ab89a1013 100644
> --- a/tools/build/feature/test-bpf.c
> +++ b/tools/build/feature/test-bpf.c
> @@ -31,5 +31,5 @@ int main(void)
>   	 * Test existence of __NR_bpf and BPF_PROG_LOAD.
>   	 * This call should fail if we run the testcase.
>   	 */
> -	return syscall(__NR_bpf, BPF_PROG_LOAD, attr, sizeof(attr));
> +	return syscall(__NR_bpf, BPF_PROG_LOAD, &attr, sizeof(attr));
>   }
Acked-by: Wang Nan <wangnan0@huawei.com>

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

* Re: [PATCH 0/2] bfp tools: Couple Coverity fixes
  2016-04-27  3:00   ` Wangnan (F)
@ 2016-04-27  3:08     ` Alexei Starovoitov
  2016-04-27 14:24       ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 13+ messages in thread
From: Alexei Starovoitov @ 2016-04-27  3:08 UTC (permalink / raw)
  To: Wangnan (F); +Cc: Florian Fainelli, linux-kernel, ast, jolsa, acme

On Wed, Apr 27, 2016 at 11:00:23AM +0800, Wangnan (F) wrote:
> 
> 
> On 2016/4/27 10:46, Florian Fainelli wrote:
> >Le 24/04/2016 19:34, Florian Fainelli a écrit :
> >>Hi all,
> >>
> >>Two trivial patches that were flagged by Coverity.
> >>
> >>Thanks!
> >Ping! Did I send this to the correct mailing-list?
> 
> Sorry for the late. You are on the right list :)

Arnaldo, please take a look. They look good to me.

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

* Re: [PATCH 1/2] bfp tools: Remove expression with no effect
  2016-04-25  2:34 ` [PATCH 1/2] bfp tools: Remove expression with no effect Florian Fainelli
@ 2016-04-27  3:11   ` Wangnan (F)
  2016-04-27 14:33     ` Arnaldo Carvalho de Melo
  2016-05-01  7:36   ` [tip:perf/core] bpf " tip-bot for Florian Fainelli
  1 sibling, 1 reply; 13+ messages in thread
From: Wangnan (F) @ 2016-04-27  3:11 UTC (permalink / raw)
  To: Florian Fainelli, linux-kernel; +Cc: ast, jolsa, acme



On 2016/4/25 10:34, Florian Fainelli wrote:
> Assigning "attr" to "attr" does not have any effect, but was caught by
> Coverity, so let's remove this.
>
> Reported-by: coverity (CID 1354720)
> Fixes: 1b76c13e4b36 ("bpf tools: Introduce 'bpf' library and add bpf feature check")
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> ---
>   tools/build/feature/test-bpf.c | 1 -
>   1 file changed, 1 deletion(-)
>
> diff --git a/tools/build/feature/test-bpf.c b/tools/build/feature/test-bpf.c
> index b389026839b9..8236df9a46ca 100644
> --- a/tools/build/feature/test-bpf.c
> +++ b/tools/build/feature/test-bpf.c
> @@ -27,7 +27,6 @@ int main(void)
>   	attr.log_level = 0;
>   	attr.kern_version = 0;
>   
> -	attr = attr;
>   	/*
>   	 * Test existence of __NR_bpf and BPF_PROG_LOAD.
>   	 * This call should fail if we run the testcase.

Tested-by: Wang Nan <wangnan0@huawei.com>

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

* Re: [PATCH 0/2] bfp tools: Couple Coverity fixes
  2016-04-27  3:08     ` Alexei Starovoitov
@ 2016-04-27 14:24       ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 13+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-04-27 14:24 UTC (permalink / raw)
  To: Alexei Starovoitov
  Cc: Wangnan (F), Florian Fainelli, linux-kernel, ast, jolsa

Em Tue, Apr 26, 2016 at 08:08:18PM -0700, Alexei Starovoitov escreveu:
> On Wed, Apr 27, 2016 at 11:00:23AM +0800, Wangnan (F) wrote:
> > 
> > 
> > On 2016/4/27 10:46, Florian Fainelli wrote:
> > >Le 24/04/2016 19:34, Florian Fainelli a écrit :
> > >>Hi all,
> > >>
> > >>Two trivial patches that were flagged by Coverity.
> > >>
> > >>Thanks!
> > >Ping! Did I send this to the correct mailing-list?
> > 
> > Sorry for the late. You are on the right list :)
> 
> Arnaldo, please take a look. They look good to me.

Will do, just readying it a 30-patch long pull req to Ingo, will collect
those for the next one, with your Acked-by tags.

- Arnaldo

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

* Re: [PATCH 1/2] bfp tools: Remove expression with no effect
  2016-04-27  3:11   ` Wangnan (F)
@ 2016-04-27 14:33     ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 13+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-04-27 14:33 UTC (permalink / raw)
  To: Wangnan (F); +Cc: Florian Fainelli, linux-kernel, ast, jolsa

Em Wed, Apr 27, 2016 at 11:11:26AM +0800, Wangnan (F) escreveu:
> 
> 
> On 2016/4/25 10:34, Florian Fainelli wrote:
> >Assigning "attr" to "attr" does not have any effect, but was caught by
> >Coverity, so let's remove this.
> >
> >Reported-by: coverity (CID 1354720)
> >Fixes: 1b76c13e4b36 ("bpf tools: Introduce 'bpf' library and add bpf feature check")
> >Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> >---
> >  tools/build/feature/test-bpf.c | 1 -
> >  1 file changed, 1 deletion(-)
> >
> >diff --git a/tools/build/feature/test-bpf.c b/tools/build/feature/test-bpf.c
> >index b389026839b9..8236df9a46ca 100644
> >--- a/tools/build/feature/test-bpf.c
> >+++ b/tools/build/feature/test-bpf.c
> >@@ -27,7 +27,6 @@ int main(void)
> >  	attr.log_level = 0;
> >  	attr.kern_version = 0;
> >-	attr = attr;
> >  	/*
> >  	 * Test existence of __NR_bpf and BPF_PROG_LOAD.
> >  	 * This call should fail if we run the testcase.
> 
> Tested-by: Wang Nan <wangnan0@huawei.com>

Applied

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

* Re: [PATCH 2/2] bfp tools: Fix syscall argument
  2016-04-27  3:01   ` Wangnan (F)
@ 2016-04-27 14:34     ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 13+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-04-27 14:34 UTC (permalink / raw)
  To: Wangnan (F); +Cc: Florian Fainelli, linux-kernel, ast, jolsa

Em Wed, Apr 27, 2016 at 11:01:43AM +0800, Wangnan (F) escreveu:
> On 2016/4/25 10:34, Florian Fainelli wrote:
> >-	return syscall(__NR_bpf, BPF_PROG_LOAD, attr, sizeof(attr));
> >+	return syscall(__NR_bpf, BPF_PROG_LOAD, &attr, sizeof(attr));
> >  }
> Acked-by: Wang Nan <wangnan0@huawei.com>

Applied, thanks.

- Arnaldo

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

* [tip:perf/core] bpf tools: Remove expression with no effect
  2016-04-25  2:34 ` [PATCH 1/2] bfp tools: Remove expression with no effect Florian Fainelli
  2016-04-27  3:11   ` Wangnan (F)
@ 2016-05-01  7:36   ` tip-bot for Florian Fainelli
  1 sibling, 0 replies; 13+ messages in thread
From: tip-bot for Florian Fainelli @ 2016-05-01  7:36 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: tglx, mingo, f.fainelli, ast, acme, wangnan0, linux-kernel, jolsa, hpa

Commit-ID:  a431d67934dfe9ffbe65972b0dbe576331595186
Gitweb:     http://git.kernel.org/tip/a431d67934dfe9ffbe65972b0dbe576331595186
Author:     Florian Fainelli <f.fainelli@gmail.com>
AuthorDate: Sun, 24 Apr 2016 19:34:53 -0700
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Thu, 28 Apr 2016 09:58:57 -0300

bpf tools: Remove expression with no effect

Assigning "attr" to "attr" does not have any effect, but was caught by
Coverity, so let's remove this.

Reported-by: coverity (CID 1354720)
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Tested-by: Wang Nan <wangnan0@huawei.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Fixes: 1b76c13e4b36 ("bpf tools: Introduce 'bpf' library and add bpf feature check")
Link: http://lkml.kernel.org/r/1461551694-5512-2-git-send-email-f.fainelli@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/build/feature/test-bpf.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/tools/build/feature/test-bpf.c b/tools/build/feature/test-bpf.c
index b389026..8236df9 100644
--- a/tools/build/feature/test-bpf.c
+++ b/tools/build/feature/test-bpf.c
@@ -27,7 +27,6 @@ int main(void)
 	attr.log_level = 0;
 	attr.kern_version = 0;
 
-	attr = attr;
 	/*
 	 * Test existence of __NR_bpf and BPF_PROG_LOAD.
 	 * This call should fail if we run the testcase.

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

* [tip:perf/core] bpf tools: Fix syscall argument
  2016-04-25  2:34 ` [PATCH 2/2] bfp tools: Fix syscall argument Florian Fainelli
  2016-04-27  3:01   ` Wangnan (F)
@ 2016-05-01  7:37   ` tip-bot for Florian Fainelli
  1 sibling, 0 replies; 13+ messages in thread
From: tip-bot for Florian Fainelli @ 2016-05-01  7:37 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: ast, mingo, linux-kernel, acme, tglx, f.fainelli, jolsa, wangnan0, hpa

Commit-ID:  1a71476e4f2693ed93523c80ff1e2d4a8634717c
Gitweb:     http://git.kernel.org/tip/1a71476e4f2693ed93523c80ff1e2d4a8634717c
Author:     Florian Fainelli <f.fainelli@gmail.com>
AuthorDate: Sun, 24 Apr 2016 19:34:54 -0700
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Thu, 28 Apr 2016 09:58:57 -0300

bpf tools: Fix syscall argument

Coverity flagged this under CID 1354884 as a sizeof mismatch, it turns
out that the argument "attr" passed to syscall should have been a
pointer to attr in the first place.

Reported-by: coverity (CID 1354884)
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Wang Nan <wangnan0@huawei.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Fixes: 8f9e05fb298f ("perf tools: Fix PowerPC native building")
Link: http://lkml.kernel.org/r/1461551694-5512-3-git-send-email-f.fainelli@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/build/feature/test-bpf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/build/feature/test-bpf.c b/tools/build/feature/test-bpf.c
index 8236df9..e04ab89 100644
--- a/tools/build/feature/test-bpf.c
+++ b/tools/build/feature/test-bpf.c
@@ -31,5 +31,5 @@ int main(void)
 	 * Test existence of __NR_bpf and BPF_PROG_LOAD.
 	 * This call should fail if we run the testcase.
 	 */
-	return syscall(__NR_bpf, BPF_PROG_LOAD, attr, sizeof(attr));
+	return syscall(__NR_bpf, BPF_PROG_LOAD, &attr, sizeof(attr));
 }

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

end of thread, other threads:[~2016-05-01  7:37 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-25  2:34 [PATCH 0/2] bfp tools: Couple Coverity fixes Florian Fainelli
2016-04-25  2:34 ` [PATCH 1/2] bfp tools: Remove expression with no effect Florian Fainelli
2016-04-27  3:11   ` Wangnan (F)
2016-04-27 14:33     ` Arnaldo Carvalho de Melo
2016-05-01  7:36   ` [tip:perf/core] bpf " tip-bot for Florian Fainelli
2016-04-25  2:34 ` [PATCH 2/2] bfp tools: Fix syscall argument Florian Fainelli
2016-04-27  3:01   ` Wangnan (F)
2016-04-27 14:34     ` Arnaldo Carvalho de Melo
2016-05-01  7:37   ` [tip:perf/core] bpf " tip-bot for Florian Fainelli
2016-04-27  2:46 ` [PATCH 0/2] bfp tools: Couple Coverity fixes Florian Fainelli
2016-04-27  3:00   ` Wangnan (F)
2016-04-27  3:08     ` Alexei Starovoitov
2016-04-27 14:24       ` Arnaldo Carvalho de Melo

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).