lkml.org 
[lkml]   [2020]   [Nov]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: [PATCH 1/1] tools/bpftool: fix error return value in build_btf_type_table()
From
Date


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@huawei.com>
> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>

LGTM.

Acked-by: Yonghong Song <yhs@fb.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;
> }
>
>

\
 
 \ /
  Last update: 2020-11-24 17:02    [W:0.089 / U:0.220 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site