projects
/
wrapfs-5.9.y.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5d06e9c
)
bpftool: Fix error return value in build_btf_type_table
author
Zhen Lei
<thunder.leizhen@huawei.com>
Tue, 24 Nov 2020 10:41:00 +0000
(18:41 +0800)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Wed, 16 Dec 2020 09:58:25 +0000
(10:58 +0100)
[ Upstream commit
68878a5c5b852d17f5827ce8a0f6fbd8b4cdfada
]
An appropriate return value should be set on the failed path.
Fixes: 4d374ba0bf30 ("tools: bpftool: implement "bpftool btf show|list"")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Yonghong Song <yhs@fb.com>
Link:
https://lore.kernel.org/bpf/20201124104100.491-1-thunder.leizhen@huawei.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/bpf/bpftool/btf.c
patch
|
blob
|
history
diff --git
a/tools/bpf/bpftool/btf.c
b/tools/bpf/bpftool/btf.c
index 8ab142ff5eac578dcd594d4699731937c366f85a..2afb7d5b1aca296c5752de1097b5aea5c2019965 100644
(file)
--- a/
tools/bpf/bpftool/btf.c
+++ b/
tools/bpf/bpftool/btf.c
@@
-693,6
+693,7
@@
build_btf_type_table(struct btf_attach_table *tab, enum bpf_obj_type type,
obj_node = calloc(1, sizeof(*obj_node));
if (!obj_node) {
p_err("failed to allocate memory: %s", strerror(errno));
+ err = -ENOMEM;
goto err_free;
}