All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] [MIPS] Fix order of BRK_BUG in case
@ 2008-04-19 20:16 Ilpo Järvinen
  2008-04-20 11:24 ` Ralf Baechle
  0 siblings, 1 reply; 3+ messages in thread
From: Ilpo Järvinen @ 2008-04-19 20:16 UTC (permalink / raw)
  To: ralf; +Cc: linux-mips

[-- Attachment #1: Type: TEXT/PLAIN, Size: 914 bytes --]


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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-04-20 18:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-19 20:16 [PATCH] [MIPS] Fix order of BRK_BUG in case Ilpo Järvinen
2008-04-20 11:24 ` Ralf Baechle
2008-04-20 18:38   ` Ilpo Järvinen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.