[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 85/88] audio: Don't free hw resources until after hw
From: |
Michael Roth |
Subject: |
[Qemu-devel] [PATCH 85/88] audio: Don't free hw resources until after hw backend is stopped |
Date: |
Thu, 8 Jan 2015 11:34:29 -0600 |
From: Peter Maydell <address@hidden>
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: address@hidden
Reviewed-by: Gerd Hoffmann <address@hidden>
Signed-off-by: Peter Maydell <address@hidden>
Message-id: address@hidden
(cherry picked from commit b28fb27b5edf77f6fd0ac550a156fb20f2218db3)
Signed-off-by: Michael Roth <address@hidden>
---
audio/audio_template.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/audio/audio_template.h b/audio/audio_template.h
index 8173188..584e536 100644
--- a/audio/audio_template.h
+++ b/audio/audio_template.h
@@ -191,9 +191,9 @@ static void glue (audio_pcm_hw_gc_, TYPE) (HW **hwp)
audio_detach_capture (hw);
#endif
QLIST_REMOVE (hw, entries);
+ glue (hw->pcm_ops->fini_, TYPE) (hw);
glue (s->nb_hw_voices_, TYPE) += 1;
glue (audio_pcm_hw_free_resources_ ,TYPE) (hw);
- glue (hw->pcm_ops->fini_, TYPE) (hw);
g_free (hw);
*hwp = NULL;
}
--
1.9.1
- [Qemu-devel] [PATCH 79/88] block migration: fix return value, (continued)
- [Qemu-devel] [PATCH 79/88] block migration: fix return value, Michael Roth, 2015/01/08
- [Qemu-devel] [PATCH 71/88] qemu-img: Check create_opts before image creation, Michael Roth, 2015/01/08
- [Qemu-devel] [PATCH 72/88] qemu-img: Check create_opts before image amendment, Michael Roth, 2015/01/08
- [Qemu-devel] [PATCH 74/88] iotests: Add test for unsupported image creation, Michael Roth, 2015/01/08
- [Qemu-devel] [PATCH 77/88] qcow2: Respect bdrv_truncate() error, Michael Roth, 2015/01/08
- [Qemu-devel] [PATCH 80/88] qcow2: Fix header extension size check, Michael Roth, 2015/01/08
- [Qemu-devel] [PATCH 76/88] qcow2: Flushing the caches in qcow2_close may fail, Michael Roth, 2015/01/08
- [Qemu-devel] [PATCH 84/88] linuxboot: fix loading old kernels, Michael Roth, 2015/01/08
- [Qemu-devel] [PATCH 83/88] linuxboot: compute initrd loading address, Michael Roth, 2015/01/08
- [Qemu-devel] [PATCH 82/88] block: Don't probe for unknown backing file format, Michael Roth, 2015/01/08
- [Qemu-devel] [PATCH 85/88] audio: Don't free hw resources until after hw backend is stopped,
Michael Roth <=
- [Qemu-devel] [PATCH 78/88] block/raw-posix: Fix ret in raw_open_common(), Michael Roth, 2015/01/08
- [Qemu-devel] [PATCH 75/88] qcow2: Prevent numerical overflow, Michael Roth, 2015/01/08
- [Qemu-devel] [PATCH 81/88] qcow2.py: Add required padding for header extensions, Michael Roth, 2015/01/08
- [Qemu-devel] [PATCH 86/88] target-xtensa: fix translation for opcodes crossing page boundary, Michael Roth, 2015/01/08
- [Qemu-devel] [PATCH 88/88] pc: acpi: mark all possible CPUs as enabled in SRAT, Michael Roth, 2015/01/08
- [Qemu-devel] [PATCH 87/88] target-xtensa: test cross-page opcode, Michael Roth, 2015/01/08
- Re: [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14, Marcel Apfelbaum, 2015/01/09