diff options
author | Manos Pitsidianakis <manos.pitsidianakis@linaro.org> | 2023-11-16 09:20:46 +0200 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2023-12-02 15:56:49 -0500 |
commit | f7856181849939ecb096dd1d0068b674fe2c69ff (patch) | |
tree | 6aac24cea989fcef25288aafd4764724989b236c /system/watchpoint.c | |
parent | 691d3d8bbde16abd002a2590fa422b079d0c8468 (diff) | |
download | qemu-f7856181849939ecb096dd1d0068b674fe2c69ff.zip qemu-f7856181849939ecb096dd1d0068b674fe2c69ff.tar.gz qemu-f7856181849939ecb096dd1d0068b674fe2c69ff.tar.bz2 |
virtio-sound: add realize() error cleanup path
QEMU crashes on exit when a virtio-sound device has failed to
realise. Its vmstate field was not cleaned up properly with
qemu_del_vm_change_state_handler().
This patch changes the realize() order as
1. Validate the given configuration values (no resources allocated
by us either on success or failure)
2. Try AUD_register_card() and return on failure (no resources allocated
by us on failure)
3. Initialize vmstate, virtio device, heap allocations and stream
parameters at once.
If error occurs, goto error_cleanup label which calls
virtio_snd_unrealize(). This cleans up all resources made in steps
1-3.
Reported-by: Volker Rümelin <vr_qemu@t-online.de>
Fixes: 2880e676c000 ("Add virtio-sound device stub")
Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Message-Id: <20231116072046.4002957-1-manos.pitsidianakis@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Diffstat (limited to 'system/watchpoint.c')
0 files changed, 0 insertions, 0 deletions