xemu/hw/audio
Paolo Bonzini 626b39006d hw/audio/hda: fix memory leak on audio setup
When SET_STREAM_FORMAT is called, the st->buft timer is overwritten, thus
causing a memory leak.  This was originally fixed in commit 816139ae6a5
("hw/audio/hda: fix memory leak on audio setup", 2024-11-14) but that
caused the audio to break in SPICE.

Fortunately, a simpler fix is possible.  The timer only needs to be
reset, because the callback is always the same (st->output is set at
realize time in hda_audio_init); call to timer_new_ns overkill.  Replace
it with timer_del and only initialize the timer once; for simplicity,
do it even if use_timer is false.

An even simpler fix would be to free the old time in hda_audio_setup().
However, it seems better to place the initialization of the timer close
to that of st->ouput.

Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Michael Tokarev <mjt@tls.msk.ru>
Message-ID: <20241114125318.1707590-3-pbonzini@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
2024-11-18 13:45:45 +01:00
..
Kconfig Add virtio-sound device stub 2023-11-07 03:39:10 -05:00
ac97.c hw: Use device_class_set_legacy_reset() instead of opencoding 2024-09-13 15:31:44 +01:00
ac97.h hw/audio/ac97: Split off some definitions to a header 2023-02-27 22:29:02 +01:00
adlib.c audio: propagate Error * out of audio_init 2023-10-03 10:29:40 +02:00
asc.c hw, target: Add ResetType argument to hold and exit phase methods 2024-04-25 10:21:06 +01:00
cs4231.c hw: Use device_class_set_legacy_reset() instead of opencoding 2024-09-13 15:31:44 +01:00
cs4231a.c hw: Use device_class_set_legacy_reset() instead of opencoding 2024-09-13 15:31:44 +01:00
es1370.c hw: Use device_class_set_legacy_reset() instead of opencoding 2024-09-13 15:31:44 +01:00
fmopl.c audio: spelling fixes 2023-09-08 13:08:52 +03:00
fmopl.h audio: spelling fixes 2023-09-08 13:08:52 +03:00
gus.c hw/audio: Constify VMState 2023-12-29 11:17:30 +11:00
gusemu.h audio: GUSsample is int16_t 2017-05-04 09:16:05 +02:00
gusemu_hal.c audio: spelling fixes 2023-09-08 13:08:52 +03:00
gusemu_mixer.c hw/audio/gus: Fix registers 32-bit access 2020-06-19 11:20:09 +02:00
gustate.h Clean up decorations and whitespace around header guards 2016-07-12 16:20:46 +02:00
hda-codec-common.h hda-codec: make mixemu selectable at runtime 2013-09-24 10:29:34 +02:00
hda-codec.c hw/audio/hda: fix memory leak on audio setup 2024-11-18 13:45:45 +01:00
intel-hda-defs.h audio: spelling fixes 2023-09-08 13:08:52 +03:00
intel-hda.c hw: Use device_class_set_legacy_reset() instead of opencoding 2024-09-13 15:31:44 +01:00
intel-hda.h hw/audio: Simplify hda audio init 2023-09-22 16:30:07 +02:00
lm4549.c hw/audio: Constify VMState 2023-12-29 11:17:30 +11:00
lm4549.h hw/audio/lm4549: Add errp error reporting to init function 2023-09-22 16:30:07 +02:00
marvell_88w8618.c hw: Use device_class_set_legacy_reset() instead of opencoding 2024-09-13 15:31:44 +01:00
meson.build Add virtio-sound-pci device 2023-11-07 03:39:10 -05:00
pcspk.c hw/audio: Constify VMState 2023-12-29 11:17:30 +11:00
pl041.c hw: Use device_class_set_legacy_reset() instead of opencoding 2024-09-13 15:31:44 +01:00
pl041.h Clean up decorations and whitespace around header guards 2016-07-12 16:20:46 +02:00
pl041.hx hw: move target-independent files to subdirectories 2013-04-08 18:13:12 +02:00
sb16.c hw/audio/sb16: Do not migrate qdev properties 2024-01-05 16:20:15 +01:00
soundhw.c replace error_setg(&error_fatal, ...) with error_report() 2024-10-21 22:40:47 +03:00
trace-events hw/audio/virtio-sound: fix heap buffer overflow 2024-09-11 09:46:14 -04:00
trace.h trace: switch position of headers to what Meson requires 2020-08-21 06:18:24 -04:00
via-ac97.c hw: Use device_class_set_legacy_reset() instead of opencoding 2024-09-13 15:31:44 +01:00
virtio-snd-pci.c hw/audio/virtio-snd-pci: fix the PCI class code 2023-12-02 15:56:49 -05:00
virtio-snd.c hw/audio/virtio-snd: Remove unnecessary "exec/tswap.h" header 2024-10-03 17:26:05 +03:00
wm8750.c hw/audio: Constify VMState 2023-12-29 11:17:30 +11:00