Patchwork [13/26] qcow2: Fix error return code in qcow2_alloc_cluster_link_l2

login
register
mail settings
Submitter Kevin Wolf
Date April 23, 2010, 3:30 p.m.
Message ID <1272036658-26776-14-git-send-email-kwolf@redhat.com>
Download mbox | patch
Permalink /patch/50829/
State New
Headers show

Comments

Kevin Wolf - April 23, 2010, 3:30 p.m.
Fix qcow2_alloc_cluster_link_l2 to return the real error code like it does in
all other error cases.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block/qcow2-cluster.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Patch

diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c
index 2f37acd..d2774d1 100644
--- a/block/qcow2-cluster.c
+++ b/block/qcow2-cluster.c
@@ -687,8 +687,8 @@  int qcow2_alloc_cluster_link_l2(BlockDriverState *bs, QCowL2Meta *m)
                     (i << s->cluster_bits)) | QCOW_OFLAG_COPIED);
      }
 
-    if (write_l2_entries(s, l2_table, l2_offset, l2_index, m->nb_clusters) < 0) {
-        ret = -1;
+    ret = write_l2_entries(s, l2_table, l2_offset, l2_index, m->nb_clusters);
+    if (ret < 0) {
         goto err;
     }