Commit bc0eb9a3 authored by Andrii Nakryiko's avatar Andrii Nakryiko Committed by Alexei Starovoitov

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: 9f81654e ("libbpf: Expose BTF-to-C type declaration emitting API")
Signed-off-by: default avatarAndrii Nakryiko <andriin@fb.com>
Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20200117060801.1311525-2-andriin@fb.com
parent 81f2b572
...@@ -142,6 +142,7 @@ struct btf_dump *btf_dump__new(const struct btf *btf, ...@@ -142,6 +142,7 @@ struct btf_dump *btf_dump__new(const struct btf *btf,
if (IS_ERR(d->type_names)) { if (IS_ERR(d->type_names)) {
err = PTR_ERR(d->type_names); err = PTR_ERR(d->type_names);
d->type_names = NULL; d->type_names = NULL;
goto err;
} }
d->ident_names = hashmap__new(str_hash_fn, str_equal_fn, NULL); d->ident_names = hashmap__new(str_hash_fn, str_equal_fn, NULL);
if (IS_ERR(d->ident_names)) { if (IS_ERR(d->ident_names)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment