]> git.proxmox.com Git - mirror_qemu.git/commitdiff
blockdev: Add missing bdrv_unref() in drive-backup
authorMax Reitz <mreitz@redhat.com>
Mon, 9 Nov 2015 22:39:10 +0000 (23:39 +0100)
committerKevin Wolf <kwolf@redhat.com>
Wed, 18 Nov 2015 15:05:56 +0000 (16:05 +0100)
All error paths after a successful bdrv_open() of target_bs should
contain a bdrv_unref(target_bs). This one did not yet, so add it.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
blockdev.c

index 917ae0687f2b29ec0fbe855c68c90d6ee218d68b..07c1741214b5be75e83458d8b5f9f0aa629021d8 100644 (file)
@@ -3171,6 +3171,7 @@ static void do_drive_backup(const char *device, const char *target,
         bmap = bdrv_find_dirty_bitmap(bs, bitmap);
         if (!bmap) {
             error_setg(errp, "Bitmap '%s' could not be found", bitmap);
+            bdrv_unref(target_bs);
             goto out;
         }
     }