linux-mips
[Top] [All Lists]

[PATCH] [MIPS] Fix order of BRK_BUG in case

To: ralf@linux-mips.org
Subject: [PATCH] [MIPS] Fix order of BRK_BUG in case
From: "Ilpo Järvinen" <ilpo.jarvinen@helsinki.fi>
Date: Sat, 19 Apr 2008 23:16:36 +0300 (EEST)
Cc: linux-mips@linux-mips.org
Original-recipient: rfc822;linux-mips@linux-mips.org
Sender: linux-mips-bounce@linux-mips.org
BRK bug is defined as 512, which is smaller than 1 << 10
resulting in left shifting bcode by 10 earlier. Without
this the code block can't ever be reached.

Problem was added in commit 63dc68a8cf ([MIPS] Use conditional
traps for BUG_ON on MIPS II and better).

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
---

I'm by no means familiar with MIPS but this seems
an appropriate fix.

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

diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
index 984c0d0..4dfcd61 100644
--- a/arch/mips/kernel/traps.c
+++ b/arch/mips/kernel/traps.c
@@ -694,7 +694,7 @@ asmlinkage void do_bp(struct pt_regs *regs)
                info.si_addr = (void __user *) regs->cp0_epc;
                force_sig_info(SIGFPE, &info, current);
                break;
-       case BRK_BUG:
+       case BRK_BUG << 10:
                die("Kernel bug detected", regs);
                break;
        default:
-- 
1.5.4.4
<Prev in Thread] Current Thread [Next in Thread>