]> git.proxmox.com Git - mirror_qemu.git/blobdiff - block/vhdx.c
Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into staging
[mirror_qemu.git] / block / vhdx.c
index 22a4fb832cbbf1494d8c20d0e5b78b242f4489e7..b0464487a56e984616d5e3dfb78603b24d7ea476 100644 (file)
@@ -1596,7 +1596,7 @@ static int vhdx_create_bat(BlockDriverState *bs, BDRVVHDXState *s,
                 bdrv_has_zero_init(bs) == 0) {
         /* for a fixed file, the default BAT entry is not zero */
         s->bat = g_try_malloc0(length);
-        if (length && s->bat != NULL) {
+        if (length && s->bat == NULL) {
             ret = -ENOMEM;
             goto exit;
         }