> On Dec 9, 2022, at 9:29 AM, John Levon <le...@movementarian.org> wrote:
> 
> On Tue, Nov 08, 2022 at 03:13:36PM -0800, John Johnson wrote:
> 
>> +static int vfio_user_io_get_irq_info(VFIODevice *vbasedev,
>> +                                     struct vfio_irq_info *irq)
>> +{
>> +    int ret;
>> +
>> +    ret = vfio_user_get_irq_info(vbasedev->proxy, irq);
>> +    if (ret) {
>> +        return ret;
>> +    }
>> +
>> +    if (irq->index > vbasedev->num_irqs) {
>> +        return -EINVAL;
>> +    }
> 
> Why are we validating ->index *after* requesting the info? Seems a bit weird?
> 

        That check is to validate the server return content (to the extent we 
can).

                                                        JJ


Reply via email to