From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:43986) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qsf22-0002IP-UD for qemu-devel@nongnu.org; Sun, 14 Aug 2011 14:03:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qsf21-0005bk-Sz for qemu-devel@nongnu.org; Sun, 14 Aug 2011 14:03:30 -0400 Received: from mail-qy0-f180.google.com ([209.85.216.180]:60182) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qsf21-0005bY-OD for qemu-devel@nongnu.org; Sun, 14 Aug 2011 14:03:29 -0400 Received: by qyk31 with SMTP id 31so2772382qyk.4 for ; Sun, 14 Aug 2011 11:03:29 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <4E480DED.2@redhat.com> Date: Sun, 14 Aug 2011 20:03:25 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1313167776-27926-1-git-send-email-peter.maydell@linaro.org> In-Reply-To: <1313167776-27926-1-git-send-email-peter.maydell@linaro.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] hw/scsi-bus.c: Fix use of uninitialised variable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: qemu-devel@nongnu.org, patches@linaro.org On 08/12/2011 06:49 PM, Peter Maydell wrote: > 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 > --- > 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); > } Acked-by: Paolo Bonzini Paolo