Skip to content
Snippets Groups Projects
Commit a17260b0 authored by Quentin Monnet's avatar Quentin Monnet Committed by Frieder Schrempf
Browse files

bpftool: Remove asserts from JIT disassembler


[ Upstream commit 55b4de58 ]

The JIT disassembler in bpftool is the only components (with the JSON
writer) using asserts to check the return values of functions. But it
does not do so in a consistent way, and diasm_print_insn() returns no
value, although sometimes the operation failed.

Remove the asserts, and instead check the return values, print messages
on errors, and propagate the error to the caller from prog.c.

Remove the inclusion of assert.h from jit_disasm.c, and also from map.c
where it is unused.

Signed-off-by: default avatarQuentin Monnet <quentin@isovalent.com>
Tested-by: default avatarNiklas Söderlund <niklas.soderlund@corigine.com>
Acked-by: default avatarSong Liu <song@kernel.org>
Link: https://lore.kernel.org/r/20221025150329.97371-3-quentin@isovalent.com


Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
Stable-dep-of: ef3ba8c258ee ("bpftool: fix potential NULL pointer dereferencing in prog_dump()")
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 817ae2e3
No related branches found
No related tags found
1 merge request!180🤖 Sync Bot: Update v6.1-ktn to Latest Stable Kernel (v6.1.124)
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment