blockdev: Add missing bdrv_unref() in drive-backup

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>
This commit is contained in:
Max Reitz 2015-11-09 23:39:10 +01:00 committed by Kevin Wolf
parent 01809194a0
commit 0702d3d88c
1 changed files with 1 additions and 0 deletions

View 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;
}
}