[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v1 14/24] vfio-user: get and set IRQs
From: |
John Johnson |
Subject: |
Re: [PATCH v1 14/24] vfio-user: get and set IRQs |
Date: |
Mon, 12 Dec 2022 20:28:37 +0000 |
> On Dec 9, 2022, at 9:29 AM, John Levon <levon@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