Skip to content

Commit b103994

Browse files
committed
objtool: Fix error handling inconsistencies in check()
JIRA: https://issues.redhat.com/browse/RHEL-85302 Conflicts: tools/objtool/check.c - cs-9 is missing upstream bd456a1 ("objtool: Separate prefix code from stack validation code"), so no need to handle opts.prefix case commit b745962 Author: Josh Poimboeuf <jpoimboe@kernel.org> Date: Fri Mar 14 12:29:00 2025 -0700 objtool: Fix error handling inconsistencies in check() Make sure all fatal errors are funneled through the 'out' label with a negative ret. Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Reviewed-by: Brendan Jackman <jackmanb@google.com> Link: https://lore.kernel.org/r/0f49d6a27a080b4012e84e6df1e23097f44cc082.1741975349.git.jpoimboe@kernel.org Signed-off-by: Joe Lawrence <joe.lawrence@redhat.com>
1 parent 8ea554c commit b103994

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tools/objtool/check.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4508,8 +4508,10 @@ int check(struct objtool_file *file)
45084508
init_cfi_state(&force_undefined_cfi);
45094509
force_undefined_cfi.force_undefined = true;
45104510

4511-
if (!cfi_hash_alloc(1UL << (file->elf->symbol_bits - 3)))
4511+
if (!cfi_hash_alloc(1UL << (file->elf->symbol_bits - 3))) {
4512+
ret = -1;
45124513
goto out;
4514+
}
45134515

45144516
cfi_hash_add(&init_cfi);
45154517
cfi_hash_add(&func_cfi);
@@ -4526,7 +4528,7 @@ int check(struct objtool_file *file)
45264528
if (opts.retpoline) {
45274529
ret = validate_retpoline(file);
45284530
if (ret < 0)
4529-
return ret;
4531+
goto out;
45304532
warnings += ret;
45314533
}
45324534

@@ -4562,7 +4564,7 @@ int check(struct objtool_file *file)
45624564
*/
45634565
ret = validate_unrets(file);
45644566
if (ret < 0)
4565-
return ret;
4567+
goto out;
45664568
warnings += ret;
45674569
}
45684570

0 commit comments

Comments
 (0)