2016-04-25 02:35:18

by Florian Fainelli

[permalink] [raw]
Subject: [PATCH 0/2] bfp tools: Couple Coverity fixes

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


2016-04-25 02:35:22

by Florian Fainelli

[permalink] [raw]
Subject: [PATCH 2/2] bfp 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)
Fixes: 8f9e05fb298f ("perf tools: Fix PowerPC native building")
Signed-off-by: Florian Fainelli <[email protected]>
---
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

2016-04-25 02:35:43

by Florian Fainelli

[permalink] [raw]
Subject: [PATCH 1/2] bfp 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)
Fixes: 1b76c13e4b36 ("bpf tools: Introduce 'bpf' library and add bpf feature check")
Signed-off-by: Florian Fainelli <[email protected]>
---
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

2016-04-27 02:46:49

by Florian Fainelli

[permalink] [raw]
Subject: Re: [PATCH 0/2] bfp tools: Couple Coverity fixes

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

2016-04-27 03:01:22

by Wang Nan

[permalink] [raw]
Subject: Re: [PATCH 0/2] bfp tools: Couple Coverity fixes



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


2016-04-27 03:02:24

by Wang Nan

[permalink] [raw]
Subject: Re: [PATCH 2/2] bfp tools: Fix syscall argument



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 <[email protected]>
> ---
> 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 <[email protected]>

2016-04-27 03:08:25

by Alexei Starovoitov

[permalink] [raw]
Subject: Re: [PATCH 0/2] bfp tools: Couple Coverity fixes

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.

2016-04-27 03:12:17

by Wang Nan

[permalink] [raw]
Subject: Re: [PATCH 1/2] bfp tools: Remove expression with no effect



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 <[email protected]>
> ---
> 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 <[email protected]>

2016-04-27 14:24:52

by Arnaldo Carvalho de Melo

[permalink] [raw]
Subject: Re: [PATCH 0/2] bfp tools: Couple Coverity fixes

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

2016-04-27 14:33:08

by Arnaldo Carvalho de Melo

[permalink] [raw]
Subject: Re: [PATCH 1/2] bfp tools: Remove expression with no effect

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 <[email protected]>
> >---
> > 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 <[email protected]>

Applied

2016-04-27 14:34:31

by Arnaldo Carvalho de Melo

[permalink] [raw]
Subject: Re: [PATCH 2/2] bfp tools: Fix syscall argument

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 <[email protected]>

Applied, thanks.

- Arnaldo