* [Qemu-devel] [PATCH] qcow2: Fix grow_refcount_table error handling
@ 2009-10-15 15:31 Kevin Wolf
0 siblings, 0 replies; only message in thread
From: Kevin Wolf @ 2009-10-15 15:31 UTC (permalink / raw)
To: qemu-devel; +Cc: Kevin Wolf
In case of failure, we haven't increased the refcount for the newly allocated
cluster yet. Therefore we must not free the cluster or its refcount will become
negative (and endless recursion is possible).
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
block/qcow2-refcount.c | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c
index 609eee1..3026678 100644
--- a/block/qcow2-refcount.c
+++ b/block/qcow2-refcount.c
@@ -182,7 +182,6 @@ static int grow_refcount_table(BlockDriverState *bs, int min_size)
qcow2_free_clusters(bs, old_table_offset, old_table_size * sizeof(uint64_t));
return 0;
fail:
- qcow2_free_clusters(bs, table_offset, new_table_size2);
qemu_free(new_table);
return -EIO;
}
--
1.6.2.5
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2009-10-15 15:32 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-15 15:31 [Qemu-devel] [PATCH] qcow2: Fix grow_refcount_table error handling Kevin Wolf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).