OSDN Git Service
(root)
/
uclinux-h8
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
da7a350
)
tools/bpftool: Fix error handing in do_skeleton()
author
YueHaibing
<yuehaibing@huawei.com>
Fri, 17 Jul 2020 12:30:59 +0000
(20:30 +0800)
committer
Alexei Starovoitov
<ast@kernel.org>
Tue, 21 Jul 2020 20:26:25 +0000
(13:26 -0700)
Fix pass 0 to PTR_ERR, also dump more err info using
libbpf_strerror.
Fixes:
5dc7a8b21144
("bpftool, selftests/bpf: Embed object file inside skeleton")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Reviewed-by: Quentin Monnet <quentin@isovalent.com>
Link:
https://lore.kernel.org/bpf/20200717123059.29624-1-yuehaibing@huawei.com
tools/bpf/bpftool/gen.c
patch
|
blob
|
history
diff --git
a/tools/bpf/bpftool/gen.c
b/tools/bpf/bpftool/gen.c
index
b59d26e
..
8a4c2b3
100644
(file)
--- a/
tools/bpf/bpftool/gen.c
+++ b/
tools/bpf/bpftool/gen.c
@@
-302,8
+302,11
@@
static int do_skeleton(int argc, char **argv)
opts.object_name = obj_name;
obj = bpf_object__open_mem(obj_data, file_sz, &opts);
if (IS_ERR(obj)) {
+ char err_buf[256];
+
+ libbpf_strerror(PTR_ERR(obj), err_buf, sizeof(err_buf));
+ p_err("failed to open BPF object file: %s", err_buf);
obj = NULL;
- p_err("failed to open BPF object file: %ld", PTR_ERR(obj));
goto out;
}