]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
audio: initialize card_head during object init
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Mon, 13 Oct 2025 20:05:22 +0000 (00:05 +0400)
committerMarc-André Lureau <marcandre.lureau@redhat.com>
Thu, 30 Oct 2025 18:56:28 +0000 (22:56 +0400)
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
audio/audio.c

index 853930bb48427bfddef5f5e21d9e5ee3ac4e5f73..bdaee7855ff3ab6ec1710db0b187c4a7690997eb 100644 (file)
@@ -1623,6 +1623,7 @@ static void audio_state_init(Object *obj)
     QLIST_INIT(&s->hw_head_out);
     QLIST_INIT(&s->hw_head_in);
     QLIST_INIT(&s->cap_head);
+    QLIST_INIT(&s->card_head);
     s->ts = timer_new_ns(QEMU_CLOCK_VIRTUAL, audio_timer, s);
 
     s->vmse = qemu_add_vm_change_state_handler(audio_vm_change_state_handler, s);
@@ -1792,7 +1793,6 @@ static AudioState *audio_init(Audiodev *dev, Error **errp)
         goto out;
     }
     object_unref(s);
-    QLIST_INIT (&s->card_head);
     return s;
 
 out: