From patchwork Mon Mar 29 13:42:57 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 48845 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 42500B7CD5 for ; Tue, 30 Mar 2010 00:45:41 +1100 (EST) Received: from localhost ([127.0.0.1]:60918 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NwFHd-0002Ff-Vf for incoming@patchwork.ozlabs.org; Mon, 29 Mar 2010 09:45:38 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NwFFA-0000UH-60 for qemu-devel@nongnu.org; Mon, 29 Mar 2010 09:43:04 -0400 Received: from [140.186.70.92] (port=32960 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NwFF8-0000SP-T7 for qemu-devel@nongnu.org; Mon, 29 Mar 2010 09:43:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NwFF7-0002Eh-NT for qemu-devel@nongnu.org; Mon, 29 Mar 2010 09:43:02 -0400 Received: from mx1.redhat.com ([209.132.183.28]:11382) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NwFF7-0002Ed-Ee for qemu-devel@nongnu.org; Mon, 29 Mar 2010 09:43:01 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o2TDh0Of022419 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 29 Mar 2010 09:43:00 -0400 Received: from zweiblum.home.kraxel.org (vpn1-7-73.ams2.redhat.com [10.36.7.73]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o2TDgwUA017213; Mon, 29 Mar 2010 09:42:59 -0400 Received: by zweiblum.home.kraxel.org (Postfix, from userid 500) id 6CB587010F; Mon, 29 Mar 2010 15:42:57 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Mon, 29 Mar 2010 15:42:57 +0200 Message-Id: <1269870177-31797-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Cc: Gerd Hoffmann Subject: [Qemu-devel] [PATCH] lsi: fix segfault in lsi_command_complete 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 Signed-off-by: Gerd Hoffmann --- hw/lsi53c895a.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/hw/lsi53c895a.c b/hw/lsi53c895a.c index a332401..525f3ca 100644 --- a/hw/lsi53c895a.c +++ b/hw/lsi53c895a.c @@ -679,7 +679,7 @@ static void lsi_command_complete(SCSIBus *bus, int reason, uint32_t tag, return; } - if (s->waiting == 1 || tag != s->current->tag || + if (s->waiting == 1 || !s->current || tag != s->current->tag || (lsi_irq_on_rsl(s) && !(s->scntl1 & LSI_SCNTL1_CON))) { if (lsi_queue_tag(s, tag, arg)) return;