From: Max Reitz Date: Mon, 9 Nov 2015 22:39:10 +0000 (+0100) Subject: blockdev: Add missing bdrv_unref() in drive-backup X-Git-Tag: qemu-xen-4.8.0-rc1~676^2~1 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=0702d3d88c2059814212b83f01e14ff3bb7b0c66;p=qemu-xen.git 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 Reviewed-by: Alberto Garcia Reviewed-by: Kevin Wolf Reviewed-by: Fam Zheng Signed-off-by: Kevin Wolf --- diff --git a/blockdev.c b/blockdev.c index 917ae0687f..07c1741214 100644 --- a/blockdev.c +++ b/blockdev.c @@ -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; } }