summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFam Zheng2018-06-27 05:57:51 +0200
committerKevin Wolf2018-06-29 14:20:56 +0200
commit354d930dc6e90e97599459b79c071ff1b93e433b (patch)
treee48b869d5921e35ba93ef8f4734a16df9b4812b4
parentfile-posix: Make .bdrv_co_truncate asynchronous (diff)
downloadqemu-354d930dc6e90e97599459b79c071ff1b93e433b.tar.gz
qemu-354d930dc6e90e97599459b79c071ff1b93e433b.tar.xz
qemu-354d930dc6e90e97599459b79c071ff1b93e433b.zip
qcow2: Remove dead check on !ret
In the beginning of the function, we initialize the local variable to 0, and in the body of the function, we check the assigned values and exit the loop immediately. So here it can never be non-zero. Reported-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Fam Zheng <famz@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
-rw-r--r--block/qcow2.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/block/qcow2.c b/block/qcow2.c
index 4a0d92860d..2d190aa00b 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -1772,7 +1772,7 @@ static coroutine_fn int qcow2_handle_l2meta(BlockDriverState *bs,
while (l2meta != NULL) {
QCowL2Meta *next;
- if (!ret && link_l2) {
+ if (link_l2) {
ret = qcow2_alloc_cluster_link_l2(bs, l2meta);
if (ret) {
goto out;