From: Dr. David Alan Gilbert Date: Tue, 24 Jul 2018 10:22:15 +0000 (+0100) Subject: audio/hda: Fix migration X-Git-Tag: qemu-xen-4.12.0-rc1~26^2~4 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=67fa1f5700248fc66d5b1526c268737e29892b86;p=qemu-xen.git audio/hda: Fix migration 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 Message-Id: <20180724102215.31866-1-dgilbert@redhat.com> Reviewed-by: Daniel P. Berrangé Reviewed-by: Juan Quintela Signed-off-by: Dr. David Alan Gilbert --- diff --git a/hw/audio/hda-codec.c b/hw/audio/hda-codec.c index 2b58c3505b..617a1c1016 100644 --- a/hw/audio/hda-codec.c +++ b/hw/audio/hda-codec.c @@ -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 = {