diff options
author | Martin KaFai Lau <kafai@fb.com> | 2018-12-12 13:18:22 -0500 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2018-12-13 06:16:31 -0500 |
commit | 177e77169b0b71587c74382d5f2207a16da34790 (patch) | |
tree | da39631926f29fbb7dd194f2b87c949631f5ebe8 /tools/lib/bpf/bpf_prog_linfo.c | |
parent | 9e794163a69c103633fefb10a3879408d4e4e2c8 (diff) |
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/bpf_prog_linfo.c')
-rw-r--r-- | tools/lib/bpf/bpf_prog_linfo.c | 6 |
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) | |||
107 | 107 | ||
108 | nr_linfo = info->nr_line_info; | 108 | nr_linfo = info->nr_line_info; |
109 | 109 | ||
110 | /* | 110 | if (!nr_linfo) |
111 | * Test !info->line_info because the kernel may NULL | ||
112 | * the ptr if kernel.kptr_restrict is set. | ||
113 | */ | ||
114 | if (!nr_linfo || !info->line_info) | ||
115 | return NULL; | 111 | return NULL; |
116 | 112 | ||
117 | /* | 113 | /* |