VirtualBox

Ignore:
Timestamp:
Feb 28, 2022 6:28:04 PM (3 years ago)
Author:
vboxsync
Message:

Devices/USB: Fix crash introduced with r150219 when a USB device is detached while the roothub tries to queue an URB but can't find the device. Also cancel all in flight URBs after the device was removed from the lookup tables in order to prevent the roothub from queueing URBs simultaneously, bugref:10196

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/USB/VUSBInternal.h

    r93989 r93993  
    484484void vusbUrbCancelAsync(PVUSBURB pUrb, CANCELMODE mode);
    485485void vusbUrbRipe(PVUSBURB pUrb);
    486 void vusbUrbCompletionRh(PVUSBURB pUrb);
     486void vusbUrbCompletionRhEx(PVUSBROOTHUB pRh, PVUSBURB pUrb);
    487487int vusbUrbSubmitHardError(PVUSBURB pUrb);
    488 int vusbUrbErrorRh(PVUSBURB pUrb);
     488int vusbUrbErrorRhEx(PVUSBROOTHUB pRh, PVUSBURB pUrb);
    489489int vusbDevUrbIoThreadWakeup(PVUSBDEV pDev);
    490490int vusbDevUrbIoThreadCreate(PVUSBDEV pDev);
     
    578578    RTCritSectLeave(&pDev->CritSectAsyncUrbs);
    579579}
     580
     581
     582DECLINLINE(int) vusbUrbErrorRh(PVUSBURB pUrb)
     583{
     584    PVUSBDEV pDev = pUrb->pVUsb->pDev;
     585    PVUSBROOTHUB pRh = vusbDevGetRh(pDev);
     586    AssertPtrReturn(pRh, VERR_VUSB_DEVICE_NOT_ATTACHED);
     587
     588    return vusbUrbErrorRhEx(pRh, pUrb);
     589}
     590
     591
     592DECLINLINE(void) vusbUrbCompletionRh(PVUSBURB pUrb)
     593{
     594    PVUSBROOTHUB pRh = vusbDevGetRh(pUrb->pVUsb->pDev);
     595    AssertPtrReturnVoid(pRh);
     596
     597    vusbUrbCompletionRhEx(pRh, pUrb);
     598}
     599
    580600
    581601/** @def vusbUrbAssert
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