From 5a11a1ca0d0ed5be52070f1da8de89ef85941183 Mon Sep 17 00:00:00 2001 From: Vladimir Sementsov-Ogievskiy Date: Tue, 2 Feb 2021 15:49:46 +0300 Subject: blockdev: fix drive_backup_prepare() missed error We leak local_err and don't report failure to the caller. It's definitely wrong, let's fix. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Greg Kurz Reviewed-by: Alberto Garcia Message-Id: <20210202124956.63146-5-vsementsov@virtuozzo.com> Signed-off-by: Eric Blake --- blockdev.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'blockdev.c') diff --git a/blockdev.c b/blockdev.c index cd438e60e3..65884a2826 100644 --- a/blockdev.c +++ b/blockdev.c @@ -1825,9 +1825,7 @@ static void drive_backup_prepare(BlkActionState *common, Error **errp) aio_context_acquire(aio_context); if (set_backing_hd) { - bdrv_set_backing_hd(target_bs, source, &local_err); - if (local_err) { - error_propagate(errp, local_err); + if (bdrv_set_backing_hd(target_bs, source, errp) < 0) { goto unref; } } -- cgit v1.2.3