summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTiezhu Yang <yangtiezhu@loongson.cn>2023-08-25 23:40:26 +0800
committerHuacai Chen <chenhuacai@loongson.cn>2023-08-25 23:40:26 +0800
commita038ae7148469ab6cf4afadb155a15d9554a0b59 (patch)
tree827358e8b90a948534941233d291d6ada079c0a5
parent6933c11fb501a40681d43336b3e0eee9df2abee0 (diff)
LoongArch: Return earlier in die() if notify_die() returns NOTIFY_STOP
After the call to oops_exit(), it should not panic or execute the crash kernel if the oops is to be suppressed. Suggested-by: Maciej W. Rozycki <macro@orcam.me.uk> Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
-rw-r--r--arch/loongarch/kernel/traps.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/loongarch/kernel/traps.c b/arch/loongarch/kernel/traps.c
index dfb34cc8b7e6..89699db45cec 100644
--- a/arch/loongarch/kernel/traps.c
+++ b/arch/loongarch/kernel/traps.c
@@ -404,6 +404,9 @@ void die(const char *str, struct pt_regs *regs)
oops_exit();
+ if (ret == NOTIFY_STOP)
+ return;
+
if (regs && kexec_should_crash(current))
crash_kexec(regs);
@@ -413,8 +416,7 @@ void die(const char *str, struct pt_regs *regs)
if (panic_on_oops)
panic("Fatal exception");
- if (ret != NOTIFY_STOP)
- make_task_dead(SIGSEGV);
+ make_task_dead(SIGSEGV);
}
static inline void setup_vint_size(unsigned int size)