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: 109876 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 19FADB6F6F for ; Sat, 13 Aug 2011 02:49:56 +1000 (EST) Received: from localhost ([::1]:60462 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qruvg-0007Cp-Hl for incoming@patchwork.ozlabs.org; Fri, 12 Aug 2011 12:49:52 -0400 Received: from eggs.gnu.org ([140.186.70.92]:57152) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qruvb-0007Ch-MH for qemu-devel@nongnu.org; Fri, 12 Aug 2011 12:49:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qruva-0001kD-JJ for qemu-devel@nongnu.org; Fri, 12 Aug 2011 12:49:47 -0400 Received: from mnementh.archaic.org.uk ([81.2.115.146]:47321) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qruva-0001jz-B0 for qemu-devel@nongnu.org; Fri, 12 Aug 2011 12:49:46 -0400 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 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 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 81.2.115.146 Cc: Paolo Bonzini , patches@linaro.org Subject: [Qemu-devel] [PATCH] hw/scsi-bus.c: Fix use of uninitialised variable X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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); }