diff options
| author | Petr Pavlu <petr.pavlu@suse.com> | 2026-10-08 17:03:08 +0200 |
|---|---|---|
| committer | Daniel Borkmann <daniel@iogearbox.net> | 2026-10-15 00:13:08 +0200 |
| commit | 201a454df948021916e051b0a84a674f4f0f9671 (patch) | |
| tree | df4f85a8d85850560385bd358db8d2bf83c1f789 /kernel/extable.c | |
| parent | 3ead4ead078f676da5b0cda0eed1584c8d3468bd (diff) | |
resolve_btfids: Fix the --fatal_warnings exit status
The resolve_btfids --fatal_warnings option is intended to make the tool
exit with a non-zero status if any warnings are reported. main()
initializes err to -1 and uses 'goto out' to return this status when
a sub-operation fails. If no error occurs,
'if (!(fatal_warnings && warnings)) err = 0;' modifies the final status
depending on whether any warnings have been reported.
Commit 522397d05e7d ("resolve_btfids: Change in-place update with raw
binary output") broke this logic by assigning the return values of newly
added sub-operations to err. As a result, successful sub-operations
overwrite the initial err value of -1 with 0, causing the tool to exit
successfully even when --fatal_warnings is enabled and warnings have been
reported.
Fix the issue by setting the final value of err unconditionally, so the
code doesn't depend on its previous value.
Fixes: 522397d05e7d ("resolve_btfids: Change in-place update with raw binary output")
Signed-off-by: Petr Pavlu <petr.pavlu@suse.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Ihor Solodrai <ihor.solodrai@linux.dev>
Link: https://lore.kernel.org/bpf/20261008-resolve_btfids-warnings-v1-1-0d4e613ffa6e@suse.com
Diffstat (limited to 'kernel/extable.c')
0 files changed, 0 insertions, 0 deletions
