]> git.proxmox.com Git - mirror_qemu.git/commit
block/gluster.c: Handle qdict_array_entries() failure
authorPeter Maydell <peter.maydell@linaro.org>
Mon, 5 Jun 2017 17:01:38 +0000 (18:01 +0100)
committerJeff Cody <jcody@redhat.com>
Fri, 9 Jun 2017 12:41:29 +0000 (08:41 -0400)
commit56faeb9bb6872b3f926b3b3e0452a70beea10af2
treec3d70acfbd0a4ca8b5b8c8a847b65fad7508586a
parent64175afc695c0672876fbbfc31b299c86d562cb4
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>
block/gluster.c