VirtualBox

Changeset 76684 in vbox for trunk/src


Ignore:
Timestamp:
Jan 7, 2019 4:40:25 PM (6 years ago)
Author:
vboxsync
Message:

Reapply r127987 and r127988 (USB: Teardown the I/O thread and sync request queue during detach to prevent the I/O thread from accessing the roothub member which was cleared already)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/USB/VUSBDevice.cpp

    r76682 r76684  
    12381238    pDev->pHub->pOps->pfnDetach(pDev->pHub, pDev);
    12391239    pDev->i16Port = -1;
     1240
     1241    /*
     1242     * Destroy I/O thread and request queue last because they might still be used
     1243     * when cancelling URBs.
     1244     */
     1245    vusbDevUrbIoThreadDestroy(pDev);
     1246
     1247    int rc = RTReqQueueDestroy(pDev->hReqQueueSync);
     1248    AssertRC(rc);
     1249    pDev->hReqQueueSync = NIL_RTREQQUEUE;
     1250
    12401251    vusbDevSetState(pDev, VUSB_DEVICE_STATE_DETACHED);
    12411252    pDev->pHub = NULL;
     
    12671278        RTCritSectDelete(&pDev->aPipes[i].CritSectCtrl);
    12681279    }
    1269 
    1270     /*
    1271      * Destroy I/O thread and request queue last because they might still be used
    1272      * when cancelling URBs.
    1273      */
    1274     vusbDevUrbIoThreadDestroy(pDev);
    1275 
    1276     int rc = RTReqQueueDestroy(pDev->hReqQueueSync);
    1277     AssertRC(rc);
    12781280
    12791281    if (pDev->hSniffer != VUSBSNIFFER_NIL)
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