Commit a1a4849c419337f649c6633219b555eb4d4d955a

Authored by Gerd Hoffmann
Committed by Linus Torvalds
1 parent 79974a0e4c

Refine SCREEN_INFO sanity check for vgacon initialization

Refine SCREEN_INFO sanity check for vgacon initialization.

Checking video mode field only to see whenever SCREEN_INFO is
initialized is not enougth, in some cases it is zero although
a vga card is present.  Lets additionally check cols and lines.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Andi Kleen <ak@suse.de>
Cc: Alan <alan@lxorguk.ukuu.org.uk>
Cc: Ingo Molnar <mingo@elte.hu>
Acked-by: Eric W. Biederman <ebiederm@xmission.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Showing 1 changed file with 7 additions and 2 deletions Side-by-side Diff

drivers/video/console/vgacon.c
... ... @@ -368,9 +368,14 @@
368 368 #endif
369 369 }
370 370  
  371 + /* SCREEN_INFO initialized? */
  372 + if ((ORIG_VIDEO_MODE == 0) &&
  373 + (ORIG_VIDEO_LINES == 0) &&
  374 + (ORIG_VIDEO_COLS == 0))
  375 + goto no_vga;
  376 +
371 377 /* VGA16 modes are not handled by VGACON */
372   - if ((ORIG_VIDEO_MODE == 0x00) || /* SCREEN_INFO not initialized */
373   - (ORIG_VIDEO_MODE == 0x0D) || /* 320x200/4 */
  378 + if ((ORIG_VIDEO_MODE == 0x0D) || /* 320x200/4 */
374 379 (ORIG_VIDEO_MODE == 0x0E) || /* 640x200/4 */
375 380 (ORIG_VIDEO_MODE == 0x10) || /* 640x350/4 */
376 381 (ORIG_VIDEO_MODE == 0x12) || /* 640x480/4 */