1
0
Fork 0

bpftool: Fix error return value in build_btf_type_table

An appropriate return value should be set on the failed path.

Fixes: 4d374ba0bf ("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
zero-sugar-mainline-defconfig
Zhen Lei 2020-11-24 18:41:00 +08:00 committed by Daniel Borkmann
parent 36ccdf8582
commit 68878a5c5b
1 changed files with 1 additions and 0 deletions

View File

@ -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;
}