[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: |
Auger Eric |
Subject: |
Re: [Qemu-devel] [PATCH v4 12/17] vfio/platform: fix a wrong returned value in vfio_populate_device |
Date: |
Thu, 6 Oct 2016 18:12:09 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 |
Hi,
On 04/10/2016 14:48, Markus Armbruster wrote:
> 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 %-)
Yes the error is severe enough to tear things down. I dared to keep it
as is since the error now is reported in the Error object.
Thanks
Eric
>
> 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;
>> }
>> }
>
- Re: [Qemu-devel] [PATCH v4 07/17] vfio/pci: Pass an error object to vfio_pci_igd_opregion_init, (continued)
- [Qemu-devel] [PATCH v4 08/17] vfio: Pass an Error object to vfio_connect_container, Eric Auger, 2016/10/03
- [Qemu-devel] [PATCH v4 06/17] vfio/pci: Pass an error object to vfio_add_capabilities, Eric Auger, 2016/10/03
- [Qemu-devel] [PATCH v4 09/17] vfio: Pass an error object to vfio_get_group, Eric Auger, 2016/10/03
- [Qemu-devel] [PATCH v4 10/17] vfio: Pass an error object to vfio_get_device, Eric Auger, 2016/10/03
- [Qemu-devel] [PATCH v4 11/17] vfio/platform: Pass an error object to vfio_populate_device, Eric Auger, 2016/10/03
- [Qemu-devel] [PATCH v4 12/17] vfio/platform: fix a wrong returned value in vfio_populate_device, Eric Auger, 2016/10/03
- [Qemu-devel] [PATCH v4 15/17] vfio/pci: Remove vfio_msix_early_setup returned value, Eric Auger, 2016/10/03
- [Qemu-devel] [PATCH v4 14/17] vfio/pci: Conversion to realize, Eric Auger, 2016/10/03
- [Qemu-devel] [PATCH v4 16/17] vfio/pci: Remove vfio_populate_device returned value, Eric Auger, 2016/10/03
- [Qemu-devel] [PATCH v4 13/17] vfio/platform: Pass an error object to vfio_base_device_init, Eric Auger, 2016/10/03