check for active_console before using it

Other vga_hw_* functions do the same.
Fixes a segmentation fault.  Trigger: boot with -nodefaults,
then connect via vnc.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
Gerd Hoffmann 2010-05-20 15:23:06 +02:00 committed by Anthony Liguori
parent 4091da4b7c
commit 26572b8a0e

View File

@ -167,7 +167,7 @@ void vga_hw_update(void)
void vga_hw_invalidate(void) void vga_hw_invalidate(void)
{ {
if (active_console->hw_invalidate) if (active_console && active_console->hw_invalidate)
active_console->hw_invalidate(active_console->hw); active_console->hw_invalidate(active_console->hw);
} }