block/iscsi: fix uninitialized variable
authorPeter Wu <peter@lekensteyn.nl>
Tue, 23 Dec 2014 15:30:41 +0000 (16:30 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Sat, 3 Jan 2015 08:22:13 +0000 (09:22 +0100)
'ret' was never initialized in the success path.

Signed-off-by: Peter Wu <peter@lekensteyn.nl>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
block/iscsi.c

index ed375fc30ea0552e6c33ff620d0d30cd26b4e075..12ddbfb095a1993d3f35a73c78d35f82120b1490 100644 (file)
@@ -1286,7 +1286,7 @@ static int iscsi_open(BlockDriverState *bs, QDict *options, int flags,
     QemuOpts *opts;
     Error *local_err = NULL;
     const char *filename;
-    int i, ret;
+    int i, ret = 0;
 
     if ((BDRV_SECTOR_SIZE % 512) != 0) {
         error_setg(errp, "iSCSI: Invalid BDRV_SECTOR_SIZE. "