diff options
author | Alan Maguire <alan.maguire@oracle.com> | 2024-06-29 13:00:58 +0300 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2024-07-01 18:05:08 +0300 |
commit | 5b747c23f17d791e08fdf4baa7e14b704625518c (patch) | |
tree | ab8242d6e3d89a3be472da66390204ad79e4d5f6 /tools/lib | |
parent | c77e572d3a8c0e21c5dca4cc2883c7cd8cbe981f (diff) | |
download | linux-5b747c23f17d791e08fdf4baa7e14b704625518c.tar.xz |
libbpf: Fix error handling in btf__distill_base()
Coverity points out that after calling btf__new_empty_split() the wrong
value is checked for error.
Fixes: 58e185a0dc35 ("libbpf: Add btf__distill_base() creating split BTF with distilled base BTF")
Reported-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Alan Maguire <alan.maguire@oracle.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20240629100058.2866763-1-alan.maguire@oracle.com
Diffstat (limited to 'tools/lib')
-rw-r--r-- | tools/lib/bpf/btf.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/lib/bpf/btf.c b/tools/lib/bpf/btf.c index cd5dd6619214..32c00db3b91b 100644 --- a/tools/lib/bpf/btf.c +++ b/tools/lib/bpf/btf.c @@ -5431,7 +5431,7 @@ int btf__distill_base(const struct btf *src_btf, struct btf **new_base_btf, * BTF available. */ new_split = btf__new_empty_split(new_base); - if (!new_split_btf) { + if (!new_split) { err = -errno; goto done; } |