linux-mips
[Top] [All Lists]

Re: [PATCH] Notifier chain called twice

To: Yury Polyanskiy <ypolyans@princeton.edu>
Subject: Re: [PATCH] Notifier chain called twice
From: Ralf Baechle <ralf@linux-mips.org>
Date: Thu, 12 May 2011 13:50:35 +0100
Cc: linux-mips@linux-mips.org, Jason Wessel <jason.wessel@windriver.com>
In-reply-to: <BANLkTikTDQgwHtK1V4AqRAALw_HrSTuvnQ@mail.gmail.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <BANLkTikTDQgwHtK1V4AqRAALw_HrSTuvnQ@mail.gmail.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.5.21 (2010-09-15)
On Tue, Apr 12, 2011 at 02:44:58AM -0400, Yury Polyanskiy wrote:

Shouldn't the conditional call be moved to an earlier location as below
patch does?  Then again once we're in die() this probably doesn't matter
terribly much anymore.

  Ralf

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

 arch/mips/kernel/traps.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
index 71350f7..e9b3af2 100644
--- a/arch/mips/kernel/traps.c
+++ b/arch/mips/kernel/traps.c
@@ -374,7 +374,8 @@ void __noreturn die(const char *str, struct pt_regs *regs)
        unsigned long dvpret = dvpe();
 #endif /* CONFIG_MIPS_MT_SMTC */
 
-       notify_die(DIE_OOPS, str, regs, 0, regs_to_trapnr(regs), SIGSEGV);
+       if (notify_die(DIE_OOPS, str, regs, 0, regs_to_trapnr(regs), SIGSEGV) 
== NOTIFY_STOP)
+               sig = 0;
 
        console_verbose();
        spin_lock_irq(&die_lock);
@@ -383,9 +384,6 @@ void __noreturn die(const char *str, struct pt_regs *regs)
        mips_mt_regdump(dvpret);
 #endif /* CONFIG_MIPS_MT_SMTC */
 
-       if (notify_die(DIE_OOPS, str, regs, 0, regs_to_trapnr(regs), SIGSEGV) 
== NOTIFY_STOP)
-               sig = 0;
-
        printk("%s[#%d]:\n", str, ++die_counter);
        show_registers(regs);
        add_taint(TAINT_DIE);

<Prev in Thread] Current Thread [Next in Thread>
  • Re: [PATCH] Notifier chain called twice, Ralf Baechle <=