From: Takashi Iwai <tiwai@suse.de>
Subject: Disable switching to bootsplash at oops/panic
Patch-mainline: Never
References: bnc#877593

The current bootsplash code may lead to double panic at outputing Oops,
as it's involved with vmalloc().  The relevant code is called only
for blanking, it's much better to skip blanking when oops_in_progress
is non-zero.  Similarly, other codes touching bootsplash should check
the oops_in_progress status, which can be easily filtered in
SPLASH_DATA() macro.

Reported-and-tested-by: Randy Wright <rwright@hp.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

---
 drivers/video/console/fbcon.c |    2 +-
 include/linux/bootsplash.h    |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/video/console/fbcon.c
+++ b/drivers/video/console/fbcon.c
@@ -2224,7 +2224,7 @@ static int fbcon_switch(struct vc_data *
 	ops = info->fbcon_par;
 
 #ifdef CONFIG_BOOTSPLASH
-	{
+	if (!oops_in_progress) {
 		struct splash_data *prev_sd = vc->vc_splash_data;
 		splash_prepare(vc, info);
 		if (vc->vc_splash_data && vc->vc_splash_data->splash_state &&
--- a/include/linux/bootsplash.h
+++ b/include/linux/bootsplash.h
@@ -63,7 +63,7 @@ extern void splash_blank(struct vc_data
 			int blank);
 
 #  define SPLASH_VERBOSE() splash_verbose()
-#  define SPLASH_DATA(x) (x->splash_data)
+#  define SPLASH_DATA(x) (oops_in_progress ? NULL : (x)->splash_data)
 #  define TEXT_WIDTH_FROM_SPLASH_DATA(x) (x->splash_data->splash_vc_text_wi)
 #  define TEXT_HIGHT_FROM_SPLASH_DATA(x) (x->splash_data->splash_vc_text_he)
 /* vt.c */
