aboutsummaryrefslogtreecommitdiff
path: root/arch/x86/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kernel')
-rw-r--r--arch/x86/kernel/dumpstack_32.c7
-rw-r--r--arch/x86/kernel/dumpstack_64.c9
2 files changed, 9 insertions, 7 deletions
diff --git a/arch/x86/kernel/dumpstack_32.c b/arch/x86/kernel/dumpstack_32.c
index 5493d31be4e..7c22f99f0ef 100644
--- a/arch/x86/kernel/dumpstack_32.c
+++ b/arch/x86/kernel/dumpstack_32.c
@@ -318,7 +318,7 @@ void __kprobes oops_end(unsigned long flags, struct pt_regs *regs, int signr)
__raw_spin_unlock(&die_lock);
raw_local_irq_restore(flags);
- if (!regs)
+ if (!signr)
return;
if (in_interrupt())
@@ -371,17 +371,18 @@ int __kprobes __die(const char *str, struct pt_regs *regs, long err)
void die(const char *str, struct pt_regs *regs, long err)
{
unsigned long flags = oops_begin();
+ int sig = SIGSEGV;
if (die_nest_count < 3) {
report_bug(regs->ip, regs);
if (__die(str, regs, err))
- regs = NULL;
+ sig = 0;
} else {
printk(KERN_EMERG "Recursive die() failure, output suppressed\n");
}
- oops_end(flags, regs, SIGSEGV);
+ oops_end(flags, regs, sig);
}
static DEFINE_SPINLOCK(nmi_print_lock);
diff --git a/arch/x86/kernel/dumpstack_64.c b/arch/x86/kernel/dumpstack_64.c
index 96a5db7da8a..ffefea611ba 100644
--- a/arch/x86/kernel/dumpstack_64.c
+++ b/arch/x86/kernel/dumpstack_64.c
@@ -465,7 +465,7 @@ void __kprobes oops_end(unsigned long flags, struct pt_regs *regs, int signr)
/* Nest count reaches zero, release the lock. */
__raw_spin_unlock(&die_lock);
raw_local_irq_restore(flags);
- if (!regs) {
+ if (!signr) {
oops_exit();
return;
}
@@ -509,13 +509,14 @@ int __kprobes __die(const char *str, struct pt_regs *regs, long err)
void die(const char *str, struct pt_regs *regs, long err)
{
unsigned long flags = oops_begin();
+ int sig = SIGSEGV;
if (!user_mode(regs))
report_bug(regs->ip, regs);
if (__die(str, regs, err))
- regs = NULL;
- oops_end(flags, regs, SIGSEGV);
+ sig = 0;
+ oops_end(flags, regs, sig);
}
notrace __kprobes void
@@ -539,7 +540,7 @@ die_nmi(char *str, struct pt_regs *regs, int do_panic)
crash_kexec(regs);
if (do_panic || panic_on_oops)
panic("Non maskable interrupt");
- oops_end(flags, NULL, SIGBUS);
+ oops_end(flags, regs, 0);
nmi_exit();
local_irq_enable();
do_exit(SIGBUS);