Commit 68878a5c authored by Zhen Lei's avatar Zhen Lei Committed by Daniel Borkmann
Browse files

bpftool: Fix error return value in build_btf_type_table



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

Fixes: 4d374ba0 ("tools: bpftool: implement "bpftool btf show|list"")
Reported-by: default avatarHulk Robot <hulkci@huawei.com>
Signed-off-by: default avatarZhen Lei <thunder.leizhen@huawei.com>
Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
Acked-by: default avatarYonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/bpf/20201124104100.491-1-thunder.leizhen@huawei.com
parent 36ccdf85
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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;
		}