diff mbox series

[v4,04/14] blockdev: fix drive_backup_prepare() missed error

Message ID 20201020130311.14311-5-vsementsov@virtuozzo.com
State Superseded
Headers show
Series block: deal with errp: part I | expand

Commit Message

Vladimir Sementsov-Ogievskiy Oct. 20, 2020, 1:03 p.m. UTC
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 <vsementsov@virtuozzo.com>
Reviewed-by: Greg Kurz <groug@kaod.org>
Reviewed-by: Alberto Garcia <berto@igalia.com>
---
 blockdev.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/blockdev.c b/blockdev.c
index 1c74490273..c70f3724d0 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -1825,8 +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) {
+        if (bdrv_set_backing_hd(target_bs, source, errp) < 0) {
             goto unref;
         }
     }