* [PATCH bpf-next] libbpf: fix error handling in btf__distill_base()
@ 2024-06-29 10:00 Alan Maguire
2024-06-29 10:04 ` Alan Maguire
2024-07-01 15:10 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Alan Maguire @ 2024-06-29 10:00 UTC (permalink / raw)
To: andrii, eddyz87
Cc: ast, daniel, jolsa, martin.lau, song, yonghong.song,
john.fastabend, kpsingh, sdf, haoluo, bpf, Alan Maguire
Coverity points out that after calling btf__new_empty_split()
the wrong value is checked for error.
Reported-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Alan Maguire <alan.maguire@oracle.com>
---
tools/lib/bpf/btf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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;
}
--
2.31.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH bpf-next] libbpf: fix error handling in btf__distill_base()
2024-06-29 10:00 [PATCH bpf-next] libbpf: fix error handling in btf__distill_base() Alan Maguire
@ 2024-06-29 10:04 ` Alan Maguire
2024-07-01 15:10 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Alan Maguire @ 2024-06-29 10:04 UTC (permalink / raw)
To: andrii, eddyz87
Cc: ast, daniel, jolsa, martin.lau, song, yonghong.song,
john.fastabend, kpsingh, sdf, haoluo, bpf
On 29/06/2024 11:00, Alan Maguire wrote:
> Coverity points out that after calling btf__new_empty_split()
> the wrong value is checked for error.
>
> Reported-by: Andrii Nakryiko <andrii@kernel.org>
> Signed-off-by: Alan Maguire <alan.maguire@oracle.com>
apologies, forgot
Fixes: 58e185a0dc35 ("libbpf: Add btf__distill_base() creating split BTF
with distilled base BTF")
> ---
> tools/lib/bpf/btf.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> 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;
> }
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH bpf-next] libbpf: fix error handling in btf__distill_base()
2024-06-29 10:00 [PATCH bpf-next] libbpf: fix error handling in btf__distill_base() Alan Maguire
2024-06-29 10:04 ` Alan Maguire
@ 2024-07-01 15:10 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-07-01 15:10 UTC (permalink / raw)
To: Alan Maguire
Cc: andrii, eddyz87, ast, daniel, jolsa, martin.lau, song,
yonghong.song, john.fastabend, kpsingh, sdf, haoluo, bpf
Hello:
This patch was applied to bpf/bpf-next.git (master)
by Daniel Borkmann <daniel@iogearbox.net>:
On Sat, 29 Jun 2024 11:00:58 +0100 you wrote:
> Coverity points out that after calling btf__new_empty_split()
> the wrong value is checked for error.
>
> Reported-by: Andrii Nakryiko <andrii@kernel.org>
> Signed-off-by: Alan Maguire <alan.maguire@oracle.com>
> ---
> tools/lib/bpf/btf.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Here is the summary with links:
- [bpf-next] libbpf: fix error handling in btf__distill_base()
https://git.kernel.org/bpf/bpf-next/c/5b747c23f17d
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-07-01 15:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-29 10:00 [PATCH bpf-next] libbpf: fix error handling in btf__distill_base() Alan Maguire
2024-06-29 10:04 ` Alan Maguire
2024-07-01 15:10 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox