summaryrefslogtreecommitdiff
path: root/tools/lib/bpf
diff options
context:
space:
mode:
authorAndrii Nakryiko <andriin@fb.com>2019-05-29 10:36:07 -0700
committerDaniel Borkmann <daniel@iogearbox.net>2019-05-30 01:23:35 +0200
commitf102154d3158c8fe9713f03bd3492f9cb8409a5e (patch)
treee918eaca7be57a5434071c4766ce48bd5ee087f4 /tools/lib/bpf
parentc51829bb6e921337014d9ac3712b0b7e8cae9f3d (diff)
libbpf: fix error code returned on corrupted ELF
All of libbpf errors are negative, except this one. Fix it. Acked-by: Song Liu <songliubraving@fb.com> Signed-off-by: Andrii Nakryiko <andriin@fb.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'tools/lib/bpf')
-rw-r--r--tools/lib/bpf/libbpf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
index 60ec9694923a..9f421206d3e7 100644
--- a/tools/lib/bpf/libbpf.c
+++ b/tools/lib/bpf/libbpf.c
@@ -1221,7 +1221,7 @@ static int bpf_object__elf_collect(struct bpf_object *obj, int flags)
if (!obj->efile.strtabidx || obj->efile.strtabidx >= idx) {
pr_warning("Corrupted ELF file: index of strtab invalid\n");
- return LIBBPF_ERRNO__FORMAT;
+ return -LIBBPF_ERRNO__FORMAT;
}
if (btf_data) {
obj->btf = btf__new(btf_data->d_buf, btf_data->d_size);