VirtualBox

Changeset 76680 in vbox for trunk


Ignore:
Timestamp:
Jan 7, 2019 3:41:09 PM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
127987
Message:

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

    r76553 r76680  
    12361236        pRh->pDefaultAddress = NULL;
    12371237
     1238    /*
     1239     * Destroy I/O thread and request queue last because they might still be used
     1240     * when cancelling URBs.
     1241     */
     1242    vusbDevUrbIoThreadDestroy(pDev);
     1243
     1244    int rc = RTReqQueueDestroy(pDev->hReqQueueSync);
     1245    AssertRC(rc);
     1246    pDev->hReqQueueSync = NIL_RTREQQUEUE;
     1247
    12381248    pDev->pHub->pOps->pfnDetach(pDev->pHub, pDev);
    12391249    pDev->i16Port = -1;
     
    12671277        RTCritSectDelete(&pDev->aPipes[i].CritSectCtrl);
    12681278    }
    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);
    12781279
    12791280    if (pDev->hSniffer != VUSBSNIFFER_NIL)
Note: See TracChangeset for help on using the changeset viewer.

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