bpftool: Fix error return value in build_btf_type_table
authorZhen Lei <thunder.leizhen@huawei.com>
Tue, 24 Nov 2020 10:41:00 +0000 (18:41 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Dec 2020 09:58:25 +0000 (10:58 +0100)
commitc709cffb95e9416496a61699e369a115a35136ff
tree6ebfc37a9a347d32e60291d577d8e88049488d44
parent5d06e9cb82f042f3b4af7cab5d9b3a1e16ae82f7
bpftool: Fix error return value in build_btf_type_table

[ 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