summaryrefslogtreecommitdiff
path: root/tools/lib/bpf
diff options
context:
space:
mode:
authorAlan Maguire <alan.maguire@oracle.com>2024-06-29 11:00:58 +0100
committerDaniel Borkmann <daniel@iogearbox.net>2024-07-01 17:05:08 +0200
commit5b747c23f17d791e08fdf4baa7e14b704625518c (patch)
treeab8242d6e3d89a3be472da66390204ad79e4d5f6 /tools/lib/bpf
parentc77e572d3a8c0e21c5dca4cc2883c7cd8cbe981f (diff)
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/bpf')
-rw-r--r--tools/lib/bpf/btf.c2
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;
}