[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH] spapr_vscsi: Set uninitialized variable
From: |
Stefan Weil |
Subject: |
[Qemu-devel] [PATCH] spapr_vscsi: Set uninitialized variable |
Date: |
Sun, 3 Apr 2011 18:21:24 +0200 |
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 <address@hidden>
---
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
- [Qemu-devel] [PATCH] spapr_vscsi: Set uninitialized variable,
Stefan Weil <=