]> git.proxmox.com Git - qemu.git/blobdiff - block/qcow2-refcount.c
Merge remote-tracking branch 'mst/tags/for_anthony' into staging
[qemu.git] / block / qcow2-refcount.c
index 6a95aa6c92da5b07e5ff1a9bb8aa32dd807f6d56..bc1784c30efe9e18b5ce1b8ac877efb15b1a16d7 100644 (file)
@@ -737,11 +737,7 @@ int qcow2_update_snapshot_refcount(BlockDriverState *bs,
      * l1_table_offset when it is the current s->l1_table_offset! Be careful
      * when changing this! */
     if (l1_table_offset != s->l1_table_offset) {
-        if (l1_size2 != 0) {
-            l1_table = g_malloc0(align_offset(l1_size2, 512));
-        } else {
-            l1_table = NULL;
-        }
+        l1_table = g_malloc0(align_offset(l1_size2, 512));
         l1_allocated = 1;
         if (bdrv_pread(bs->file, l1_table_offset,
                        l1_table, l1_size2) != l1_size2)