From: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
To: qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
Manos Pitsidianakis <manos.pitsidianakis@linaro.org>,
Gerd Hoffmann <kraxel@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>
Subject: [PATCH] virtio-snd: check AUD_register_card return value
Date: Thu, 9 Nov 2023 18:20:35 +0200 [thread overview]
Message-ID: <20231109162034.2108018-1-manos.pitsidianakis@linaro.org> (raw)
AUD_register_card might fail. Even though errp was passed as an
argument, the call's return value was not checked for failure.
Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
---
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 a18a9949a7..ccf5fcf99e 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;
base-commit: ad6ef0a42e314a8c6ac6c96d5f6e607a1e5644b5
--
2.39.2
next reply other threads:[~2023-11-09 16:22 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-09 16:20 Manos Pitsidianakis [this message]
2023-11-09 16:25 ` [PATCH] virtio-snd: check AUD_register_card return value Peter Maydell
2023-11-09 17:53 ` Michael S. Tsirkin
2023-11-09 18:03 ` Peter Maydell
2023-11-09 23:23 ` Michael S. Tsirkin
2023-11-10 9:26 ` Manos Pitsidianakis
2023-11-09 17:42 ` Philippe Mathieu-Daudé
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231109162034.2108018-1-manos.pitsidianakis@linaro.org \
--to=manos.pitsidianakis@linaro.org \
--cc=kraxel@redhat.com \
--cc=mst@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).