bfp tools: Couple Coverity fixes
cover 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(-)
Signature · 1 line
2.7.4
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.
--- tools/build/feature/test-bpf.c | 1 - 1 file changed, 1 deletion(-)
tools/build/feature/test-bpf.c +0 -1
@@ -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.
Signature · 1 line
2.7.4
Re: [PATCH 1/2] bfp tools: Remove expression with no effect
Quoted 15 lines · 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 <[email protected]>--- tools/build/feature/test-bpf.c | 1 - 1 file changed, 1 deletion(-)tools/build/feature/test-bpf.c +0
-0
tools/build/feature/test-bpf.c int main(void) · line 32
Quoted 7 lines
tools/build/feature/test-bpf.c +0
-1@@ -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.
Arnaldo Carvalho de Melo
AppliedRe: [PATCH 1/2] bfp tools: Remove expression with no effect
Em Wed, Apr 27, 2016 at 11:11:26AM +0800, Wangnan (F) escreveu:
Quoted 13 lines · Florian Fainelli
Quoted 10 lines
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(-)
Quoted 13 lines
tools/build/feature/test-bpf.c int main(void) · line 31
Quoted 11 lines
tools/build/feature/test-bpf.c +0
-1@@ -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
tip-bot for Florian Fainelli
merge bot[tip:perf/core] bpf tools: Remove expression with no effect
In reply to Florian Fainellibpf tools: Remove expression with no effect
Commit-ID: a431d67934dfe9ffbe65972b0dbe576331595186 Gitweb: http://git.kernel.org/tip/a431d67934dfe9ffbe65972b0dbe576331595186 Author: Florian Fainelli <[email protected]> AuthorDate: Sun, 24 Apr 2016 19:34:53 -0700 Committer: Arnaldo Carvalho de Melo <[email protected]> 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.
--- tools/build/feature/test-bpf.c | 1 - 1 file changed, 1 deletion(-)
tools/build/feature/test-bpf.c +0 -1
@@ -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.
PATCH 2/2 bfp tools: Fix syscall argument
In reply to Florian FainelliCoverity 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.
--- tools/build/feature/test-bpf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/build/feature/test-bpf.c +1 -1
@@ -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)); }
Signature · 1 line
2.7.4
Re: [PATCH 2/2] bfp tools: Fix syscall argument
Quoted 16 lines · 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 <[email protected]>--- tools/build/feature/test-bpf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/build/feature/test-bpf.c +0
-0
tools/build/feature/test-bpf.c int main(void) · line 35
Quoted 6 lines
tools/build/feature/test-bpf.c +1
-1@@ -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)); }
Arnaldo Carvalho de Melo
AppliedRe: [PATCH 2/2] bfp tools: Fix syscall argument
Em Wed, Apr 27, 2016 at 11:01:43AM +0800, Wangnan (F) escreveu:
Quoted 5 lines · Florian Fainelli
tools/build/feature/test-bpf.c int main(void) · line 35
Quoted 3 lines
tools/build/feature/test-bpf.c +1
-1-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
tip-bot for Florian Fainelli
merge bot[tip:perf/core] bpf tools: Fix syscall argument
In reply to Florian Fainellibpf tools: Fix syscall argument
Commit-ID: 1a71476e4f2693ed93523c80ff1e2d4a8634717c Gitweb: http://git.kernel.org/tip/1a71476e4f2693ed93523c80ff1e2d4a8634717c Author: Florian Fainelli <[email protected]> AuthorDate: Sun, 24 Apr 2016 19:34:54 -0700 Committer: Arnaldo Carvalho de Melo <[email protected]> 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.
--- tools/build/feature/test-bpf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/build/feature/test-bpf.c +1 -1
@@ -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)); }
Quoted 5 lines · Florian Fainelli
Hi all,
Two trivial patches that were flagged by Coverity.
Thanks!
Ping! Did I send this to the correct mailing-list?
Signature · 1 line
Florian
Quoted 7 lines · Florian Fainelli
Quoted 5 lines · Florian Fainelli
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 :)
Quoted 4 lines · Wangnan (F)
Quoted 1 line · Florian Fainelli
Le 24/04/2016 19:34, Florian Fainelli a écrit :
Quoted 8 lines
Quoted 6 lines
Quoted 5 lines
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.
Em Tue, Apr 26, 2016 at 08:08:18PM -0700, Alexei Starovoitov escreveu:
Quoted 7 lines · Wangnan (F)
Quoted 6 lines · Florian Fainelli
Quoted 3 lines · Florian Fainelli
Quoted 2 lines
Hi all,
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Quoted 3 lines
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