From patchwork Fri Aug 12 16:49:36 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 3435 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id D25B02406F for ; Fri, 12 Aug 2011 16:49:43 +0000 (UTC) Received: from mail-qw0-f52.google.com (mail-qw0-f52.google.com [209.85.216.52]) by fiordland.canonical.com (Postfix) with ESMTP id 933A6A18487 for ; Fri, 12 Aug 2011 16:49:43 +0000 (UTC) Received: by qwb8 with SMTP id 8so2433340qwb.11 for ; Fri, 12 Aug 2011 09:49:43 -0700 (PDT) Received: by 10.229.62.150 with SMTP id x22mr812076qch.136.1313167783033; Fri, 12 Aug 2011 09:49:43 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.229.190.71 with SMTP id dh7cs155650qcb; Fri, 12 Aug 2011 09:49:42 -0700 (PDT) Received: from mr.google.com ([10.227.13.77]) by 10.227.13.77 with SMTP id b13mr1280751wba.54.1313167782187 (num_hops = 1); Fri, 12 Aug 2011 09:49:42 -0700 (PDT) Received: by 10.227.13.77 with SMTP id b13mr1065888wba.54.1313167780685; Fri, 12 Aug 2011 09:49:40 -0700 (PDT) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk [81.2.115.146]) by mx.google.com with ESMTPS id fw18si8699559wbb.31.2011.08.12.09.49.40 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 12 Aug 2011 09:49:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 81.2.115.146 as permitted sender) client-ip=81.2.115.146; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 81.2.115.146 as permitted sender) smtp.mail=pm215@archaic.org.uk Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.72) (envelope-from ) id 1QruvQ-0007Gr-Nx; Fri, 12 Aug 2011 17:49:36 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Paolo Bonzini Subject: [PATCH] hw/scsi-bus.c: Fix use of uninitialised variable Date: Fri, 12 Aug 2011 17:49:36 +0100 Message-Id: <1313167776-27926-1-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 Don't use req before it has been initialised in scsi_req_new(). This fixes a compile failure due to gcc complaining about this. Signed-off-by: Peter Maydell Acked-by: Paolo Bonzini --- hw/scsi-bus.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/hw/scsi-bus.c b/hw/scsi-bus.c index f2af6cd..559d5a4 100644 --- a/hw/scsi-bus.c +++ b/hw/scsi-bus.c @@ -372,7 +372,7 @@ SCSIRequest *scsi_req_new(SCSIDevice *d, uint32_t tag, uint32_t lun, } else { trace_scsi_req_parsed(d->id, lun, tag, buf[0], cmd.mode, cmd.xfer); - if (req->cmd.lba != -1) { + if (cmd.lba != -1) { trace_scsi_req_parsed_lba(d->id, lun, tag, buf[0], cmd.lba); }