Skip to contentSkip to conversation

block/qcow2-bitmap: fix free_bitmap_clusters

PATCH Applied Vladimir Sementsov-Ogievskiy 2 participants 2 messages Jun 8, 2018 – Jun 9, 2018 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 block/qcow2-bitmap: fix free_bitmap_clusters

This assert may fail, because bitmap_table is not initialized. Just drop it, as it's obvious, that bitmap_table_load sets bitmap_table parameter only when returning zero.

---
 block/qcow2-bitmap.c | 1 -
 1 file changed, 1 deletion(-)
block/qcow2-bitmap.c +0 -1
index 60d5290f10..69485aa1de 100644
@@ -254,7 +254,6 @@ static int free_bitmap_clusters(BlockDriverState *bs, Qcow2BitmapTable *tb)
 
     ret = bitmap_table_load(bs, tb, &bitmap_table);
     if (ret < 0) {
-        assert(bitmap_table == NULL);
         return ret;
     }
 
Signature · 1 line
2.11.1
Applied
#1 lore raw
Quoted 9 lines · Vladimir Sementsov-Ogievskiy

This assert may fail, because bitmap_table is not initialized. Just drop it, as it's obvious, that bitmap_table_load sets bitmap_table parameter only when returning zero.

---
 block/qcow2-bitmap.c | 1 -
 1 file changed, 1 deletion(-)

Thanks, applied to my block branch:

https://git.xanclic.moe/XanClic/qemu/commits/branch/block

Max