From: Kevin Wolf Date: Tue, 23 Mar 2010 11:53:47 +0000 (+0100) Subject: qcow2: Fix error return code in qcow2_alloc_cluster_link_l2 X-Git-Tag: pull-nvme-20200902~12030 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=c835d00fc8d6c23af7e9182981ef7a07f1c6d12c;p=qemu-nvme.git qcow2: Fix error return code in qcow2_alloc_cluster_link_l2 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 --- diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c index 2f37acdb6b..d2774d19ca 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; }