summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Maydell2017-06-05 19:01:38 +0200
committerJeff Cody2017-06-09 14:41:29 +0200
commit56faeb9bb6872b3f926b3b3e0452a70beea10af2 (patch)
treec3d70acfbd0a4ca8b5b8c8a847b65fad7508586a
parentarm_gicv3: Fix ICC_BPR1 reset value when EL3 not implemented (diff)
downloadqemu-56faeb9bb6872b3f926b3b3e0452a70beea10af2.tar.gz
qemu-56faeb9bb6872b3f926b3b3e0452a70beea10af2.tar.xz
qemu-56faeb9bb6872b3f926b3b3e0452a70beea10af2.zip
block/gluster.c: Handle qdict_array_entries() failure
In qemu_gluster_parse_json(), the call to qdict_array_entries() could return a negative error code, which we were ignoring because we assigned the result to an unsigned variable. Fix this by using the 'int' type instead, which matches the return type of qdict_array_entries() and also the type we use for the loop enumeration variable 'i'. (Spotted by Coverity, CID 1360960.) Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Jeff Cody <jcody@redhat.com> Message-id: 1496682098-1540-1-git-send-email-peter.maydell@linaro.org Signed-off-by: Jeff Cody <jcody@redhat.com>
-rw-r--r--block/gluster.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/block/gluster.c b/block/gluster.c
index 031596adbc..addceed6eb 100644
--- a/block/gluster.c
+++ b/block/gluster.c
@@ -493,8 +493,7 @@ static int qemu_gluster_parse_json(BlockdevOptionsGluster *gconf,
Error *local_err = NULL;
char *str = NULL;
const char *ptr;
- size_t num_servers;
- int i, type;
+ int i, type, num_servers;
/* create opts info from runtime_json_opts list */
opts = qemu_opts_create(&runtime_json_opts, NULL, 0, &error_abort);