]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
objtool: Fix broken error handling in read_symbols()
authorJosh Poimboeuf <jpoimboe@kernel.org>
Wed, 17 Sep 2025 16:03:22 +0000 (09:03 -0700)
committerJosh Poimboeuf <jpoimboe@kernel.org>
Tue, 14 Oct 2025 21:45:23 +0000 (14:45 -0700)
commit9ebb662fab38a5942100e597b48de5ec9d5e714d
treee83bd2b18317eebcd5de1af10295408907ccfc03
parent07e1c3fd86d7a2ddce3ebc6b7390590c8524a484
objtool: Fix broken error handling in read_symbols()

The free(sym) call in the read_symbols() error path is fundamentally
broken: 'sym' doesn't point to any allocated block.  If triggered,
things would go from bad to worse.

Remove the free() and simplify the error paths.  Freeing memory isn't
necessary here anyway, these are fatal errors which lead to an immediate
exit().

Acked-by: Petr Mladek <pmladek@suse.com>
Tested-by: Joe Lawrence <joe.lawrence@redhat.com>
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
tools/objtool/elf.c