From ae11f6ca66f2de9a7e2f0445ac870824e7fa8eee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Tue, 9 Apr 2024 17:11:33 +0400 Subject: [PATCH] block/block-copy: fix -Werror=maybe-uninitialized false-positive MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ../block/block-copy.c:591:12: error: ‘ret’ may be used uninitialized [-Werror=maybe-uninitialized] Signed-off-by: Marc-André Lureau Reviewed-by: Vladimir Sementsov-Ogievskiy --- block/block-copy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/block-copy.c b/block/block-copy.c index 93eb1b2664..eddb0b81e0 100644 --- a/block/block-copy.c +++ b/block/block-copy.c @@ -584,7 +584,7 @@ static coroutine_fn int block_copy_task_entry(AioTask *task) BlockCopyState *s = t->s; bool error_is_read = false; BlockCopyMethod method = t->method; - int ret; + int ret = -1; WITH_GRAPH_RDLOCK_GUARD() { ret = block_copy_do_copy(s, t->req.offset, t->req.bytes, &method,