From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=43147 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q6Q3i-0002Ny-Aw for qemu-devel@nongnu.org; Sun, 03 Apr 2011 12:22:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q6Q3U-0004J5-Ir for qemu-devel@nongnu.org; Sun, 03 Apr 2011 12:21:41 -0400 Received: from moutng.kundenserver.de ([212.227.126.187]:61374) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q6Q3U-0004HH-8I for qemu-devel@nongnu.org; Sun, 03 Apr 2011 12:21:36 -0400 From: Stefan Weil Date: Sun, 3 Apr 2011 18:21:24 +0200 Message-Id: <1301847684-8125-1-git-send-email-weil@mail.berlios.de> Subject: [Qemu-devel] [PATCH] spapr_vscsi: Set uninitialized variable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: QEMU Developers cppcheck reports this error: hw/spapr_vscsi.c:274: error: Uninitialized variable: rc If llen == 0, rc was indeed used without being initialized. Signed-off-by: Stefan Weil --- hw/spapr_vscsi.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/hw/spapr_vscsi.c b/hw/spapr_vscsi.c index e142dae..9928334 100644 --- a/hw/spapr_vscsi.c +++ b/hw/spapr_vscsi.c @@ -255,7 +255,7 @@ static int vscsi_srp_direct_data(VSCSIState *s, vscsi_req *req, { struct srp_direct_buf *md = req->cur_desc; uint32_t llen; - int rc; + int rc = 0; dprintf("VSCSI: direct segment 0x%x bytes, va=0x%llx desc len=0x%x\n", len, (unsigned long long)md->va, md->len); -- 1.7.2.5