]> git.proxmox.com Git - mirror_qemu.git/commitdiff
audio/hda: Fix migration
authorDr. David Alan Gilbert <dgilbert@redhat.com>
Tue, 24 Jul 2018 10:22:15 +0000 (11:22 +0100)
committerDr. David Alan Gilbert <dgilbert@redhat.com>
Tue, 24 Jul 2018 16:02:02 +0000 (17:02 +0100)
Fix outgoing migration which was crashing in
vmstate_hda_audio_stream_buf_needed, I think the problem
is that we have room for upto 4 streams in the array but only
use 2, when we come to try and save the state of the unused
streams we hit st->state == NULL.

Fixes: 280c1e1cdb24d80ecdfc
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-Id: <20180724102215.31866-1-dgilbert@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
hw/audio/hda-codec.c

index 2b58c3505bdec73d27feb89fdc732688827cbbdb..617a1c1016b8ea06403493b2848cac69ff46ba16 100644 (file)
@@ -786,7 +786,7 @@ static void hda_audio_reset(DeviceState *dev)
 static bool vmstate_hda_audio_stream_buf_needed(void *opaque)
 {
     HDAAudioStream *st = opaque;
-    return st->state->use_timer;
+    return st->state && st->state->use_timer;
 }
 
 static const VMStateDescription vmstate_hda_audio_stream_buf = {