aboutsummaryrefslogtreecommitdiffstats
path: root/tools/lib/bpf/btf_dump.c
diff options
context:
space:
mode:
authorAndrii Nakryiko <andriin@fb.com>2020-01-16 22:07:58 -0800
committerAlexei Starovoitov <ast@kernel.org>2020-01-17 08:33:17 -0800
commitbc0eb9a333918d2cc4f42f7f4cf09eaf029ac9de (patch)
tree38d803f76d5523637b4cb1736c124c6f3e0a4da9 /tools/lib/bpf/btf_dump.c
parentbpf: Remove set but not used variable 'first_key' (diff)
downloadlinux-dev-bc0eb9a333918d2cc4f42f7f4cf09eaf029ac9de.tar.xz
linux-dev-bc0eb9a333918d2cc4f42f7f4cf09eaf029ac9de.zip
libbpf: Fix error handling bug in btf_dump__new
Fix missing jump to error handling in btf_dump__new, found by Coverity static code analysis. Fixes: 9f81654eebe8 ("libbpf: Expose BTF-to-C type declaration emitting API") Signed-off-by: Andrii Nakryiko <andriin@fb.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Link: https://lore.kernel.org/bpf/20200117060801.1311525-2-andriin@fb.com
Diffstat (limited to '')
-rw-r--r--tools/lib/bpf/btf_dump.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/lib/bpf/btf_dump.c b/tools/lib/bpf/btf_dump.c
index 885acebd4396..bd09ed1710f1 100644
--- a/tools/lib/bpf/btf_dump.c
+++ b/tools/lib/bpf/btf_dump.c
@@ -142,6 +142,7 @@ struct btf_dump *btf_dump__new(const struct btf *btf,
if (IS_ERR(d->type_names)) {
err = PTR_ERR(d->type_names);
d->type_names = NULL;
+ goto err;
}
d->ident_names = hashmap__new(str_hash_fn, str_equal_fn, NULL);
if (IS_ERR(d->ident_names)) {