projects
/
linux
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c77e572
)
libbpf: Fix error handling in btf__distill_base()
author
Alan Maguire
<alan.maguire@oracle.com>
Sat, 29 Jun 2024 10:00:58 +0000
(11:00 +0100)
committer
Daniel Borkmann
<daniel@iogearbox.net>
Mon, 1 Jul 2024 15:05:08 +0000
(17:05 +0200)
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
tools/lib/bpf/btf.c
patch
|
blob
|
history
diff --git
a/tools/lib/bpf/btf.c
b/tools/lib/bpf/btf.c
index cd5dd6619214c27de4ee45578ac8ad6b6cbdc87d..32c00db3b91b9d1e91c8a0cb71fa2c263bcc459e 100644
(file)
--- 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;
}