Hi Jonathan, On Tue, Sep 23, 2025 at 09:23:33PM +0000, Jonathan Cavitt wrote: > Add error handling for the following VFIO_DEVICE_SET_IRQS cases with > respect to the hdr struct: > > - More than one VFIO_IRQ_DATA_TYPE_MASK flag is set in hdr.flags > - More than one VFIO_IRQ_ACTION_TYPE_MASK flag is set in hdr.flags > - hdr.count is not specified > > Note that since hdr.count != 0, data_size != 0 is guaranteed unless > vfio_set_irqs_validate_and_prepare fails and returns an error. So, we > no longer need to check data_size before running memdup_user because > checking the return value of the function is sufficient. > > v2: Use correct name for mask > > v3: Use is_power_of_2 over hweight32 as it's more efficient (Andi)
Thanks for sending v3. I was about to reply that I would rather merge the patch as it is and adjust it later. A change like the one I suggested should go through another CI test. Before merging we should limit changes to comments, commit log and at most minor coding style fixes. > Signed-off-by: Jonathan Cavitt <[email protected]> > Cc: Andi Shyti <[email protected]> > Reviewed-by: Zhenyu Wang <[email protected]> Reviewed-by: Andi Shyti <[email protected]> Andi
