Browse Source

[PATCH] exit: fix crash case

If we are going to BUG() not panic() here then we should cover the case of
the BUG being compiled out

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Alan Cox 18 years ago
parent
commit
54306cf04c
1 changed files with 2 additions and 1 deletions
  1. 2 1
      kernel/exit.c

+ 2 - 1
kernel/exit.c

@@ -963,7 +963,8 @@ fastcall NORET_TYPE void do_exit(long code)
 	schedule();
 	schedule();
 	BUG();
 	BUG();
 	/* Avoid "noreturn function does return".  */
 	/* Avoid "noreturn function does return".  */
-	for (;;) ;
+	for (;;)
+		cpu_relax();	/* For when BUG is null */
 }
 }
 
 
 EXPORT_SYMBOL_GPL(do_exit);
 EXPORT_SYMBOL_GPL(do_exit);