aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Brucker <jean-philippe.brucker@arm.com>2019-04-04 14:20:42 +0100
committerWill Deacon <will.deacon@arm.com>2019-04-26 14:57:59 +0100
commitca14d9eded5aa786675b28ba1d9c06bde33182f6 (patch)
tree69b822761ef80fcddf876d22402ccd7ba84cf92b
parent20b65266ce86e6253eac5813e285e3c30713fe2a (diff)
downloadkvmtool-ca14d9eded5aa786675b28ba1d9c06bde33182f6.tar.gz
qcow: Fix qcow1 exit fault
Even though qcow1 doesn't use the refcount table, the cleanup path still attempts to iterate over its LRU list. Initialize the list to avoid a segfault on exit. Reviewed-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Jean-Philippe Brucker <jean-philippe.brucker@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
-rw-r--r--disk/qcow.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/disk/qcow.c b/disk/qcow.c
index 64cf9270..bed70c65 100644
--- a/disk/qcow.c
+++ b/disk/qcow.c
@@ -1437,6 +1437,7 @@ static struct disk_image *qcow1_probe(int fd, bool readonly)
l1t->root = (struct rb_root)RB_ROOT;
INIT_LIST_HEAD(&l1t->lru_list);
+ INIT_LIST_HEAD(&q->refcount_table.lru_list);
h = q->header = qcow1_read_header(fd);
if (!h)