[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <47b51fb4-0a47-9d8e-187d-14bb7d475b05@fb.com>
Date: Tue, 24 Nov 2020 08:00:06 -0800
From: Yonghong Song <yhs@...com>
To: Zhen Lei <thunder.leizhen@...wei.com>,
Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Andrii Nakryiko <andrii@...nel.org>,
Martin KaFai Lau <kafai@...com>,
Song Liu <songliubraving@...com>,
John Fastabend <john.fastabend@...il.com>,
KP Singh <kpsingh@...omium.org>,
netdev <netdev@...r.kernel.org>, bpf <bpf@...r.kernel.org>,
linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/1] tools/bpftool: fix error return value in
build_btf_type_table()
On 11/24/20 2:41 AM, Zhen Lei wrote:
> An appropriate return value should be set on the failed path.
>
> Reported-by: Hulk Robot <hulkci@...wei.com>
> Signed-off-by: Zhen Lei <thunder.leizhen@...wei.com>
LGTM.
Acked-by: Yonghong Song <yhs@...com>
Also this is a bug fix. It should probably be targeted to bpf tree. So,
Fixes: 4d374ba0bf30 ("tools: bpftool: implement "bpftool btf show|list"")
> ---
> tools/bpf/bpftool/btf.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/tools/bpf/bpftool/btf.c b/tools/bpf/bpftool/btf.c
> index 8ab142ff5eac..2afb7d5b1aca 100644
> --- 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;
> }
>
>
Powered by blists - more mailing lists