qemu-devel
[Top][All Lists]
Advanced

[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 Levon
Subject: Re: [PATCH v1 14/24] vfio-user: get and set IRQs
Date: Fri, 9 Dec 2022 17:29:40 +0000

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?

regards
john



reply via email to

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