| .. | .. |
|---|
| 31 | 31 | { |
|---|
| 32 | 32 | static int die_counter; |
|---|
| 33 | 33 | int ret; |
|---|
| 34 | + long cause; |
|---|
| 35 | + unsigned long flags; |
|---|
| 34 | 36 | |
|---|
| 35 | 37 | oops_enter(); |
|---|
| 36 | 38 | |
|---|
| 37 | | - spin_lock_irq(&die_lock); |
|---|
| 39 | + spin_lock_irqsave(&die_lock, flags); |
|---|
| 38 | 40 | console_verbose(); |
|---|
| 39 | 41 | bust_spinlocks(1); |
|---|
| 40 | 42 | |
|---|
| 41 | 43 | pr_emerg("%s [#%d]\n", str, ++die_counter); |
|---|
| 42 | 44 | print_modules(); |
|---|
| 43 | | - show_regs(regs); |
|---|
| 45 | + if (regs) |
|---|
| 46 | + show_regs(regs); |
|---|
| 44 | 47 | |
|---|
| 45 | | - ret = notify_die(DIE_OOPS, str, regs, 0, regs->cause, SIGSEGV); |
|---|
| 48 | + cause = regs ? regs->cause : -1; |
|---|
| 49 | + ret = notify_die(DIE_OOPS, str, regs, 0, cause, SIGSEGV); |
|---|
| 46 | 50 | |
|---|
| 47 | | - if (regs && kexec_should_crash(current)) |
|---|
| 51 | + if (kexec_should_crash(current)) |
|---|
| 48 | 52 | crash_kexec(regs); |
|---|
| 49 | 53 | |
|---|
| 50 | 54 | bust_spinlocks(0); |
|---|
| 51 | 55 | add_taint(TAINT_DIE, LOCKDEP_NOW_UNRELIABLE); |
|---|
| 52 | | - spin_unlock_irq(&die_lock); |
|---|
| 56 | + spin_unlock_irqrestore(&die_lock, flags); |
|---|
| 53 | 57 | oops_exit(); |
|---|
| 54 | 58 | |
|---|
| 55 | 59 | if (in_interrupt()) |
|---|
| .. | .. |
|---|
| 57 | 61 | if (panic_on_oops) |
|---|
| 58 | 62 | panic("Fatal exception"); |
|---|
| 59 | 63 | if (ret != NOTIFY_STOP) |
|---|
| 60 | | - do_exit(SIGSEGV); |
|---|
| 64 | + make_task_dead(SIGSEGV); |
|---|
| 61 | 65 | } |
|---|
| 62 | 66 | |
|---|
| 63 | 67 | void do_trap(struct pt_regs *regs, int signo, int code, unsigned long addr) |
|---|