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