From 451532311a6c37ac58794305c88307bd7c54526f Mon Sep 17 00:00:00 2001 From: Vladimir Sementsov-Ogievskiy Date: Tue, 24 Aug 2021 11:38:33 +0300 Subject: [PATCH] block/copy-before-write: drop extra bdrv_unref on failure path bdrv_attach_child() do bdrv_unref() on failure, so we shouldn't do it by hand here. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz Message-Id: <20210824083856.17408-12-vsementsov@virtuozzo.com> Signed-off-by: Hanna Reitz --- block/copy-before-write.c | 1 - 1 file changed, 1 deletion(-) diff --git a/block/copy-before-write.c b/block/copy-before-write.c index 2a51cc64e4..945d9340f4 100644 --- a/block/copy-before-write.c +++ b/block/copy-before-write.c @@ -201,7 +201,6 @@ BlockDriverState *bdrv_cbw_append(BlockDriverState *source, state->target = bdrv_attach_child(top, target, "target", &child_of_bds, BDRV_CHILD_DATA, errp); if (!state->target) { - bdrv_unref(target); bdrv_unref(top); return NULL; }