qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v4 12/17] vfio/platform: fix a wrong returned va


From: Markus Armbruster
Subject: Re: [Qemu-devel] [PATCH v4 12/17] vfio/platform: fix a wrong returned value in vfio_populate_device
Date: Tue, 04 Oct 2016 14:48:18 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Eric Auger <address@hidden> writes:

> In case the vfio_init_intp fails we currently do not return an
> error value. This patch fixes the bug. The returned value is not
> explicit but in practice the error object is the one used to
> report the error to the end-user and the actual returned error
> value is not used.

The function's contract permits this by neglecting to say anything about
the return value %-)

The callers don't actually care about the value.

> Signed-off-by: Eric Auger <address@hidden>
> ---
>  hw/vfio/platform.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/hw/vfio/platform.c b/hw/vfio/platform.c
> index 1a35da0..484e31f 100644
> --- a/hw/vfio/platform.c
> +++ b/hw/vfio/platform.c
> @@ -508,6 +508,7 @@ static int vfio_populate_device(VFIODevice *vbasedev, 
> Error **errp)
>                                                      irq.flags);
>              intp = vfio_init_intp(vbasedev, irq, errp);
>              if (!intp) {
> +                ret = -1;
>                  goto irq_err;
>              }
>          }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]