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>
This commit is contained in:
parent
e60bdfb78e
commit
691d3d8bbd
@ -1102,7 +1102,9 @@ static void virtio_snd_realize(DeviceState *dev, Error **errp)
|
|||||||
return;
|
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 */
|
/* set default params for all streams */
|
||||||
default_params.features = 0;
|
default_params.features = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user