block: Fix Transaction leak in bdrv_reopen_multiple()
authorKevin Wolf <kwolf@redhat.com>
Mon, 3 May 2021 11:05:55 +0000 (13:05 +0200)
committerKevin Wolf <kwolf@redhat.com>
Tue, 18 May 2021 09:08:13 +0000 (11:08 +0200)
Like other error paths, this one needs to call tran_finalize() and clean
up the BlockReopenQueue, too.

Fixes: CID 1452772
Fixes: 72373e40fbc7e4218061a8211384db362d3e7348
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20210503110555.24001-3-kwolf@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block.c

diff --git a/block.c b/block.c
index 6dbe9af2cd67dd70961ec44bfba1ec5c6f1eabda..0dc97281dcfd09c964720c93d5d27e0940bb313d 100644 (file)
--- a/block.c
+++ b/block.c
@@ -4050,7 +4050,7 @@ int bdrv_reopen_multiple(BlockReopenQueue *bs_queue, Error **errp)
         ret = bdrv_flush(bs_entry->state.bs);
         if (ret < 0) {
             error_setg_errno(errp, -ret, "Error flushing drive");
-            goto cleanup;
+            goto abort;
         }
     }