On Thu, 9 Nov 2023 at 16:21, Manos Pitsidianakis
<manos.pitsidiana...@linaro.org> wrote:
>
> AUD_register_card might fail. Even though errp was passed as an
> argument, the call's return value was not checked for failure.

For whoever picks up this patch: we can add
"Fixes Coverity CID 1523899" to the commit message.

> Signed-off-by: Manos Pitsidianakis <manos.pitsidiana...@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;

Reviewed-by: Peter Maydell <peter.mayd...@linaro.org>

thanks
-- PMM

Reply via email to