From patchwork Tue May 18 19:45:33 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: check for active_console before using it Date: Tue, 18 May 2010 09:45:33 -0000 From: Gerd Hoffmann X-Patchwork-Id: 52916 Message-Id: <1274211933-20173-1-git-send-email-kraxel@redhat.com> To: qemu-devel@nongnu.org Cc: Gerd Hoffmann Other vga_hw_* functions do the same. Fixes a segmentation fault. Trigger: boot with -nodefaults, then connect via vnc. Signed-off-by: Gerd Hoffmann --- console.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/console.c b/console.c index 7070b1b..4c42b28 100644 --- a/console.c +++ b/console.c @@ -167,7 +167,7 @@ void vga_hw_update(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); }