From patchwork Thu May 20 13:23:06 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 53071 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id B315AB7D29 for ; Thu, 20 May 2010 23:30:39 +1000 (EST) Received: from localhost ([127.0.0.1]:50239 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OF5pa-000504-IL for incoming@patchwork.ozlabs.org; Thu, 20 May 2010 09:30:34 -0400 Received: from [140.186.70.92] (port=40568 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OF5iW-0000HT-5s for qemu-devel@nongnu.org; Thu, 20 May 2010 09:23:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OF5iR-0001EU-6L for qemu-devel@nongnu.org; Thu, 20 May 2010 09:23:16 -0400 Received: from mx1.redhat.com ([209.132.183.28]:29014) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OF5iQ-0001EN-Tm for qemu-devel@nongnu.org; Thu, 20 May 2010 09:23:11 -0400 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o4KDNA3N016880 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 20 May 2010 09:23:10 -0400 Received: from zweiblum.home.kraxel.org (vpn1-7-100.ams2.redhat.com [10.36.7.100]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o4KDN9tK009421; Thu, 20 May 2010 09:23:09 -0400 Received: by zweiblum.home.kraxel.org (Postfix, from userid 500) id 6BA6A7012A; Thu, 20 May 2010 15:23:07 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Thu, 20 May 2010 15:23:06 +0200 Message-Id: <1274361786-4898-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.16 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Cc: Gerd Hoffmann Subject: [Qemu-devel] [PATCH] check for active_console before using it X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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); }