projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b0294bc
)
samples/bpf: test_cgrp2_sock2: fix an off by one
author
Dan Carpenter
<dan.carpenter@oracle.com>
Fri, 13 Jul 2018 15:05:37 +0000
(18:05 +0300)
committer
Alexei Starovoitov
<ast@kernel.org>
Mon, 16 Jul 2018 22:01:09 +0000
(15:01 -0700)
"prog_cnt" is the number of elements which are filled out in prog_fd[]
so the test should be >= instead of >.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: David Ahern <dsahern@gmail.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
samples/bpf/test_cgrp2_sock2.c
patch
|
blob
|
history
diff --git
a/samples/bpf/test_cgrp2_sock2.c
b/samples/bpf/test_cgrp2_sock2.c
index 3b5be2364975ae26b4dc8166c5c925bc1907aab1..a9277b118c330b09f3c253785d20999d02c6410f 100644
(file)
--- a/
samples/bpf/test_cgrp2_sock2.c
+++ b/
samples/bpf/test_cgrp2_sock2.c
@@
-51,7
+51,7
@@
int main(int argc, char **argv)
if (argc > 3)
filter_id = atoi(argv[3]);
- if (filter_id > prog_cnt) {
+ if (filter_id >
=
prog_cnt) {
printf("Invalid program id; program not found in file\n");
return EXIT_FAILURE;
}