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;