audio: Don't free hw resources until after hw backend is stopped
commit6569578197d93fcfeec4eb3e48c0659c18142dee
authorPeter Maydell <peter.maydell@linaro.org>
Tue, 16 Dec 2014 16:58:05 +0000 (16 16:58 +0000)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Sun, 22 Feb 2015 18:27:26 +0000 (22 12:27 -0600)
tree3b5aa8a277e3a1cba28191beb0ad07a8cc7cb935
parent51d703ff2e03285be7ba0433d814a688c923b1ea
audio: Don't free hw resources until after hw backend is stopped

When stopping an audio voice, call the audio backend's fini
method before calling audio_pcm_hw_free_resources_ rather than
afterwards. This allows backends which use helper threads (like
pulseaudio) to terminate those threads before the conv_buf or
mix_buf are freed and avoids race conditions where the helper
may access a NULL pointer or freed memory.

Cc: qemu-stable@nongnu.org
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1418406239-9838-1-git-send-email-peter.maydell@linaro.org
(cherry picked from commit b28fb27b5edf77f6fd0ac550a156fb20f2218db3)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
audio/audio_template.h