Blame SOURCES/kvm-qcow2-Remove-dead-check-on-ret.patch

383d26
From 3e96785b4f89d97ca8297e2ea4ed2458409422ec Mon Sep 17 00:00:00 2001
383d26
From: John Snow <jsnow@redhat.com>
383d26
Date: Wed, 18 Jul 2018 22:54:48 +0200
383d26
Subject: [PATCH 63/89] qcow2: Remove dead check on !ret
383d26
MIME-Version: 1.0
383d26
Content-Type: text/plain; charset=UTF-8
383d26
Content-Transfer-Encoding: 8bit
383d26
383d26
RH-Author: John Snow <jsnow@redhat.com>
383d26
Message-id: <20180718225511.14878-13-jsnow@redhat.com>
383d26
Patchwork-id: 81409
383d26
O-Subject: [RHEL-7.6 qemu-kvm-rhev PATCH 12/35] qcow2: Remove dead check on !ret
383d26
Bugzilla: 1207657
383d26
RH-Acked-by: Eric Blake <eblake@redhat.com>
383d26
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
383d26
RH-Acked-by: Fam Zheng <famz@redhat.com>
383d26
383d26
From: Fam Zheng <famz@redhat.com>
383d26
383d26
In the beginning of the function, we initialize the local variable to 0,
383d26
and in the body of the function, we check the assigned values and exit
383d26
the loop immediately. So here it can never be non-zero.
383d26
383d26
Reported-by: Kevin Wolf <kwolf@redhat.com>
383d26
Signed-off-by: Fam Zheng <famz@redhat.com>
383d26
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
383d26
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
383d26
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
383d26
(cherry picked from commit 354d930dc6e90e97599459b79c071ff1b93e433b)
383d26
Signed-off-by: John Snow <jsnow@redhat.com>
383d26
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
383d26
---
383d26
 block/qcow2.c | 2 +-
383d26
 1 file changed, 1 insertion(+), 1 deletion(-)
383d26
383d26
diff --git a/block/qcow2.c b/block/qcow2.c
383d26
index c5341a4..e171a99 100644
383d26
--- a/block/qcow2.c
383d26
+++ b/block/qcow2.c
383d26
@@ -1772,7 +1772,7 @@ static coroutine_fn int qcow2_handle_l2meta(BlockDriverState *bs,
383d26
     while (l2meta != NULL) {
383d26
         QCowL2Meta *next;
383d26
 
383d26
-        if (!ret && link_l2) {
383d26
+        if (link_l2) {
383d26
             ret = qcow2_alloc_cluster_link_l2(bs, l2meta);
383d26
             if (ret) {
383d26
                 goto out;
383d26
-- 
383d26
1.8.3.1
383d26