aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorChuck Ebbert <76306.1226@compuserve.com>2006-07-14 03:23:58 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-07-15 00:53:51 -0400
commitb7015331098cc156c30282588bbd30bbf7a59291 (patch)
tree349b2933b488e1e686eb1fdcb83e1552adcb50e3 /arch
parentc38c8db7225465c8d124f38b24d3024decc26bbd (diff)
[PATCH] i386: handle_BUG(): don't print garbage if debug info unavailable
handle_BUG() tries to print file and line number even when they're not available (CONFIG_DEBUG_BUGVERBOSE is not set.) Change this to print a message stating info is unavailable instead of printing a misleading message. Signed-off-by: Chuck Ebbert <76306.1226@compuserve.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/i386/kernel/traps.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/arch/i386/kernel/traps.c b/arch/i386/kernel/traps.c
index 5cfd4f42eeba..313ac1f7dc5a 100644
--- a/arch/i386/kernel/traps.c
+++ b/arch/i386/kernel/traps.c
@@ -324,35 +324,35 @@ void show_registers(struct pt_regs *regs)
324 324
325static void handle_BUG(struct pt_regs *regs) 325static void handle_BUG(struct pt_regs *regs)
326{ 326{
327 unsigned long eip = regs->eip;
327 unsigned short ud2; 328 unsigned short ud2;
328 unsigned short line;
329 char *file;
330 char c;
331 unsigned long eip;
332
333 eip = regs->eip;
334 329
335 if (eip < PAGE_OFFSET) 330 if (eip < PAGE_OFFSET)
336 goto no_bug; 331 return;
337 if (__get_user(ud2, (unsigned short __user *)eip)) 332 if (__get_user(ud2, (unsigned short __user *)eip))
338 goto no_bug; 333 return;
339 if (ud2 != 0x0b0f) 334 if (ud2 != 0x0b0f)
340 goto no_bug; 335 return;
341 if (__get_user(line, (unsigned short __user *)(eip + 2)))
342 goto bug;
343 if (__get_user(file, (char * __user *)(eip + 4)) ||
344 (unsigned long)file < PAGE_OFFSET || __get_user(c, file))
345 file = "<bad filename>";
346 336
347 printk(KERN_EMERG "------------[ cut here ]------------\n"); 337 printk(KERN_EMERG "------------[ cut here ]------------\n");
348 printk(KERN_EMERG "kernel BUG at %s:%d!\n", file, line);
349 338
350no_bug: 339#ifdef CONFIG_DEBUG_BUGVERBOSE
351 return; 340 do {
341 unsigned short line;
342 char *file;
343 char c;
352 344
353 /* Here we know it was a BUG but file-n-line is unavailable */ 345 if (__get_user(line, (unsigned short __user *)(eip + 2)))
354bug: 346 break;
355 printk(KERN_EMERG "Kernel BUG\n"); 347 if (__get_user(file, (char * __user *)(eip + 4)) ||
348 (unsigned long)file < PAGE_OFFSET || __get_user(c, file))
349 file = "<bad filename>";
350
351 printk(KERN_EMERG "kernel BUG at %s:%d!\n", file, line);
352 return;
353 } while (0);
354#endif
355 printk(KERN_EMERG "Kernel BUG at [verbose debug info unavailable]\n");
356} 356}
357 357
358/* This is gone through when something in the kernel 358/* This is gone through when something in the kernel