diff options
author | 2023-04-19 12:07:27 +0800 | |
---|---|---|
committer | 2023-04-19 12:07:27 +0800 | |
commit | 370a3b8f58743eceb97c5256538d6048c26d2d03 (patch) | |
tree | 64444dac60c812d9622e2d4e3f68150f313c7183 /arch/loongarch/kernel/stacktrace.c | |
parent | LoongArch: Adjust user_regset_copyin parameter to the correct offset (diff) | |
download | linux-370a3b8f58743eceb97c5256538d6048c26d2d03.tar.gz linux-370a3b8f58743eceb97c5256538d6048c26d2d03.tar.bz2 linux-370a3b8f58743eceb97c5256538d6048c26d2d03.zip |
LoongArch: Check unwind_error() in arch_stack_walk()
We can see the following messages with CONFIG_PROVE_LOCKING=y on
LoongArch:
BUG: MAX_STACK_TRACE_ENTRIES too low!
turning off the locking correctness validator.
This is because stack_trace_save() returns a big value after call
arch_stack_walk(), here is the call trace:
save_trace()
stack_trace_save()
arch_stack_walk()
stack_trace_consume_entry()
arch_stack_walk() should return immediately if unwind_next_frame()
failed, no need to do the useless loops to increase the value of c->len
in stack_trace_consume_entry(), then we can fix the above problem.
Cc: stable@vger.kernel.org
Reported-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/all/8a44ad71-68d2-4926-892f-72bfc7a67e2a@roeck-us.net/
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Diffstat (limited to 'arch/loongarch/kernel/stacktrace.c')
-rw-r--r-- | arch/loongarch/kernel/stacktrace.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/loongarch/kernel/stacktrace.c b/arch/loongarch/kernel/stacktrace.c index 3a690f96f00c..2463d2fea21f 100644 --- a/arch/loongarch/kernel/stacktrace.c +++ b/arch/loongarch/kernel/stacktrace.c @@ -30,7 +30,7 @@ void arch_stack_walk(stack_trace_consume_fn consume_entry, void *cookie, regs->regs[1] = 0; for (unwind_start(&state, task, regs); - !unwind_done(&state); unwind_next_frame(&state)) { + !unwind_done(&state) && !unwind_error(&state); unwind_next_frame(&state)) { addr = unwind_get_return_address(&state); if (!addr || !consume_entry(cookie, addr)) break; |