aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf/progs/bpf_iter_task_stack.c
diff options
context:
space:
mode:
authorSong Liu <[email protected]>2020-07-03 18:17:19 +0000
committerDaniel Borkmann <[email protected]>2020-07-03 21:25:40 +0000
commit9ff79af3331277c69ac61cc75b2392eb3284e305 (patch)
tree6a5a329465fe171783af5ce474422013851c1802 /tools/testing/selftests/bpf/progs/bpf_iter_task_stack.c
parentbpf: Fix bpftool without skeleton code enabled (diff)
downloadkernel-9ff79af3331277c69ac61cc75b2392eb3284e305.tar.gz
kernel-9ff79af3331277c69ac61cc75b2392eb3284e305.zip
selftests/bpf: Fix compilation error of bpf_iter_task_stack.c
BPF selftests show a compilation error as follows: libbpf: invalid relo for 'entries' in special section 0xfff2; forgot to initialize global var?.. Fix it by initializing 'entries' to zeros. Fixes: c7568114bc56 ("selftests/bpf: Add bpf_iter test with bpf_get_task_stack()") Reported-by: Jesper Dangaard Brouer <[email protected]> Signed-off-by: Song Liu <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'tools/testing/selftests/bpf/progs/bpf_iter_task_stack.c')
-rw-r--r--tools/testing/selftests/bpf/progs/bpf_iter_task_stack.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/selftests/bpf/progs/bpf_iter_task_stack.c b/tools/testing/selftests/bpf/progs/bpf_iter_task_stack.c
index e40d32a2ed93..50e59a2e142e 100644
--- a/tools/testing/selftests/bpf/progs/bpf_iter_task_stack.c
+++ b/tools/testing/selftests/bpf/progs/bpf_iter_task_stack.c
@@ -7,7 +7,7 @@
char _license[] SEC("license") = "GPL";
#define MAX_STACK_TRACE_DEPTH 64
-unsigned long entries[MAX_STACK_TRACE_DEPTH];
+unsigned long entries[MAX_STACK_TRACE_DEPTH] = {};
#define SIZE_OF_ULONG (sizeof(unsigned long))
SEC("iter/task")