aboutsummaryrefslogtreecommitdiffstats
path: root/tools/lib/bpf
diff options
context:
space:
mode:
authorMartin KaFai Lau <kafai@fb.com>2018-12-12 10:18:22 -0800
committerDaniel Borkmann <daniel@iogearbox.net>2018-12-13 12:16:31 +0100
commit177e77169b0b71587c74382d5f2207a16da34790 (patch)
treeda39631926f29fbb7dd194f2b87c949631f5ebe8 /tools/lib/bpf
parentbpf: Remove bpf_dump_raw_ok() check for func_info and line_info (diff)
downloadlinux-dev-177e77169b0b71587c74382d5f2207a16da34790.tar.xz
linux-dev-177e77169b0b71587c74382d5f2207a16da34790.zip
bpf: Remove !func_info and !line_info check from test_btf and bpftool
kernel can provide the func_info and line_info even it fails the btf_dump_raw_ok() test because they don't contain kernel address. This patch removes the corresponding '== 0' test. Signed-off-by: Martin KaFai Lau <kafai@fb.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'tools/lib/bpf')
-rw-r--r--tools/lib/bpf/bpf_prog_linfo.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/tools/lib/bpf/bpf_prog_linfo.c b/tools/lib/bpf/bpf_prog_linfo.c
index addd6e9971cc..6978314ea7f6 100644
--- a/tools/lib/bpf/bpf_prog_linfo.c
+++ b/tools/lib/bpf/bpf_prog_linfo.c
@@ -107,11 +107,7 @@ struct bpf_prog_linfo *bpf_prog_linfo__new(const struct bpf_prog_info *info)
nr_linfo = info->nr_line_info;
- /*
- * Test !info->line_info because the kernel may NULL
- * the ptr if kernel.kptr_restrict is set.
- */
- if (!nr_linfo || !info->line_info)
+ if (!nr_linfo)
return NULL;
/*