util/coroutine: fix -Werror=maybe-uninitialized false-positive
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Thu, 28 Mar 2024 10:20:34 +0000 (14:20 +0400)
committerMarc-André Lureau <marcandre.lureau@redhat.com>
Wed, 2 Oct 2024 12:14:29 +0000 (16:14 +0400)
../util/qemu-coroutine.c:150:8: error: ‘batch’ may be used uninitialized [-Werror=maybe-uninitialized]

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
util/qemu-coroutine.c

index eb4eebefdfb5d18b0c8a19f575b292e8e5e03260..64d6264fc745d22e74bd329c1bef15bcd100ba15 100644 (file)
@@ -136,7 +136,7 @@ static Coroutine *coroutine_pool_get_local(void)
 static void coroutine_pool_refill_local(void)
 {
     CoroutinePool *local_pool = get_ptr_local_pool();
-    CoroutinePoolBatch *batch;
+    CoroutinePoolBatch *batch = NULL;
 
     WITH_QEMU_LOCK_GUARD(&global_pool_lock) {
         batch = QSLIST_FIRST(&global_pool);