projects
/
platform
/
kernel
/
linux-rpi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e21aa34
)
libbpf: Fix error path in bpf_object__elf_init()
author
Namhyung Kim
<namhyung@kernel.org>
Wed, 17 Mar 2021 14:54:14 +0000
(23:54 +0900)
committer
Daniel Borkmann
<daniel@iogearbox.net>
Wed, 17 Mar 2021 23:42:21 +0000
(
00:42
+0100)
When it failed to get section names, it should call into
bpf_object__elf_finish() like others.
Fixes:
88a82120282b
("libbpf: Factor out common ELF operations and improve logging")
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link:
https://lore.kernel.org/bpf/20210317145414.884817-1-namhyung@kernel.org
tools/lib/bpf/libbpf.c
patch
|
blob
|
history
diff --git
a/tools/lib/bpf/libbpf.c
b/tools/lib/bpf/libbpf.c
index
d43cc3f
..
4181d17
100644
(file)
--- a/
tools/lib/bpf/libbpf.c
+++ b/
tools/lib/bpf/libbpf.c
@@
-1181,7
+1181,8
@@
static int bpf_object__elf_init(struct bpf_object *obj)
if (!elf_rawdata(elf_getscn(obj->efile.elf, obj->efile.shstrndx), NULL)) {
pr_warn("elf: failed to get section names strings from %s: %s\n",
obj->path, elf_errmsg(-1));
- return -LIBBPF_ERRNO__FORMAT;
+ err = -LIBBPF_ERRNO__FORMAT;
+ goto errout;
}
/* Old LLVM set e_machine to EM_NONE */