Thread (3 messages) 3 messages, 3 authors, 2020-11-24
STALE2063d LANDED

[PATCH 1/1] tools/bpftool: fix error return value in build_btf_type_table()

From: Zhen Lei <hidden>
Date: 2020-11-24 10:41:51
Also in: bpf, lkml
Subsystem: bpf [general] (safe dynamic programs and tools), bpf [tooling] (bpftool), the rest · Maintainers: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko, Eduard Zingerman, Kumar Kartikeya Dwivedi, Quentin Monnet, Linus Torvalds

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

Reported-by: Hulk Robot <redacted>
Signed-off-by: Zhen Lei <redacted>
---
 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;
 		}
 
-- 
2.26.0.106.g9fadedd

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help