diff options
author | Manos Pitsidianakis <manos.pitsidianakis@linaro.org> | 2023-11-09 18:20:35 +0200 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2023-12-02 15:56:49 -0500 |
commit | 691d3d8bbde16abd002a2590fa422b079d0c8468 (patch) | |
tree | 3c952dfd9db0448f5432dcdb7bfbc073ddfe3b86 | |
parent | e60bdfb78e41b0cee8beb21bc9c2bb2749f4ef6b (diff) | |
download | qemu-691d3d8bbde16abd002a2590fa422b079d0c8468.zip qemu-691d3d8bbde16abd002a2590fa422b079d0c8468.tar.gz qemu-691d3d8bbde16abd002a2590fa422b079d0c8468.tar.bz2 |
virtio-snd: check AUD_register_card return value
AUD_register_card might fail. Even though errp was passed as an
argument, the call's return value was not checked for failure.
Fixes: Coverity CID 1523899
Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Message-Id: <20231109162034.2108018-1-manos.pitsidianakis@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
-rw-r--r-- | hw/audio/virtio-snd.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/hw/audio/virtio-snd.c b/hw/audio/virtio-snd.c index 2fe966e..83e9785 100644 --- a/hw/audio/virtio-snd.c +++ b/hw/audio/virtio-snd.c @@ -1102,7 +1102,9 @@ static void virtio_snd_realize(DeviceState *dev, Error **errp) return; } - AUD_register_card("virtio-sound", &vsnd->card, errp); + if (!AUD_register_card("virtio-sound", &vsnd->card, errp)) { + return; + } /* set default params for all streams */ default_params.features = 0; |