[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 07/15] virtio-snd: check AUD_register_card return value
From: |
Michael S. Tsirkin |
Subject: |
[PULL 07/15] virtio-snd: check AUD_register_card return value |
Date: |
Fri, 1 Dec 2023 12:15:25 -0500 |
From: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
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>
---
hw/audio/virtio-snd.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/hw/audio/virtio-snd.c b/hw/audio/virtio-snd.c
index 2fe966e311..83e97858e0 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;
--
MST
- [PULL 00/15] virtio,pc,pci: fixes, Michael S. Tsirkin, 2023/12/01
- [PULL 04/15] hw/audio/virtio-snd-pci: fix the PCI class code, Michael S. Tsirkin, 2023/12/01
- [PULL 05/15] hw/audio/hda-codec: fix multiplication overflow, Michael S. Tsirkin, 2023/12/01
- [PULL 01/15] osdep: add getloadavg, Michael S. Tsirkin, 2023/12/01
- [PULL 07/15] virtio-snd: check AUD_register_card return value,
Michael S. Tsirkin <=
- [PULL 15/15] vhost-user-scsi: free the inflight area when reset, Michael S. Tsirkin, 2023/12/01
- [PULL 02/15] netdev: set timeout depending on loadavg, Michael S. Tsirkin, 2023/12/01
- [PULL 03/15] tests/acpi/bios-tables-test: do not write new blobs unless there are changes, Michael S. Tsirkin, 2023/12/01
- [PULL 09/15] pcie_sriov: Remove g_new assertion, Michael S. Tsirkin, 2023/12/01
- [PULL 10/15] hw/acpi/erst: Do not ignore Error* in realize handler, Michael S. Tsirkin, 2023/12/01
- [PULL 12/15] virtio-iommu: Remove useless !sdev check in virtio_iommu_probe(), Michael S. Tsirkin, 2023/12/01
- [PULL 08/15] virtio-sound: add realize() error cleanup path, Michael S. Tsirkin, 2023/12/01
- [PULL 14/15] vhost-user: fix the reconnect error, Michael S. Tsirkin, 2023/12/01