VirtualBox

Changeset 96719 in vbox for trunk


Ignore:
Timestamp:
Sep 13, 2022 12:35:45 PM (2 years ago)
Author:
vboxsync
Message:

USBProxyDevice-linux.cpp: Put struct usbdevfs_urb KUrb in a union with padding for the necessary length to make it work better with Linux 6.0 flexible array changes. bugref:10279

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/USB/linux/USBProxyDevice-linux.cpp

    r96407 r96719  
    101101# pragma GCC diagnostic ignored "-Wpedantic"
    102102#endif
    103     struct usbdevfs_urb             KUrb;
     103    union
     104    {
     105        struct usbdevfs_urb         KUrb;
     106        /** Make sure we've got sufficient space for isochronous packets. */
     107        uint8_t                     abKUrbPadding[  RT_UOFFSETOF(struct usbdevfs_urb, iso_frame_desc)
     108                                                  + sizeof(struct usbdevfs_iso_packet_desc) * 8];
     109    };
    104110#if RT_GNUC_PREREQ(6, 0)
    105111# pragma GCC diagnostic pop
    106112#endif
    107     /** Space filler for the isochronous packets. */
    108     struct usbdevfs_iso_packet_desc aIsocPktsDonUseTheseUseTheOnesInKUrb[8];
    109113    /** Node to link the URB in of the existing lists. */
    110114    RTLISTNODE                      NodeList;
     
    15741578            if (pUrb->enmType == VUSBXFERTYPE_ISOC)
    15751579            {
     1580                AssertCompile(   sizeof(pUrbLnx->abKUrbPadding)
     1581                              >=   RT_UOFFSETOF(struct usbdevfs_urb, iso_frame_desc)
     1582                                 + sizeof(struct usbdevfs_iso_packet_desc) * RT_ELEMENTS(pUrb->aIsocPkts));
    15761583                unsigned i, off;
    15771584                for (i = 0, off = 0; i < pUrb->cIsocPkts; i++)
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette