VirtualBox

Changeset 46806 in vbox for trunk/src


Ignore:
Timestamp:
Jun 26, 2013 2:24:17 PM (11 years ago)
Author:
vboxsync
Message:

USB: respect the case that vusbDevGetRh() returns NULL

Location:
trunk/src/VBox/Devices/USB
Files:
3 edited

Legend:

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

    r45755 r46806  
    996996
    997997    PVUSBROOTHUB pRh = vusbDevGetRh(pDev);
     998    AssertPtrReturnVoid(pRh);
    998999    if (pDev->u8Address == VUSB_DEFAULT_ADDRESS)
    9991000        pRh->pDefaultAddress = NULL;
     
    10351036{
    10361037    PVUSBROOTHUB pRh = vusbDevGetRh(pDev);
     1038    AssertPtrReturnVoid(pRh);
    10371039
    10381040    /*
  • trunk/src/VBox/Devices/USB/VUSBReadAhead.cpp

    r44528 r46806  
    369369    if (pArgs)
    370370    {
     371        PVUSBROOTHUB pRh = vusbDevGetRh(pDev);
    371372        pArgs->pDev  = pDev;
    372373        pArgs->pPipe = pPipe;
    373374        pArgs->fTerminate = false;
    374         pArgs->fHighSpeed = ((vusbDevGetRh(pDev)->fHcVersions & VUSB_STDVER_20) != 0);
     375        pArgs->fHighSpeed = pRh && ((pRh->fHcVersions & VUSB_STDVER_20) != 0);
    375376        if (pArgs->fHighSpeed)
    376377            rc = RTThreadCreate(&pPipe->ReadAheadThread, vusbDevReadAheadThread, pArgs, 0, RTTHREADTYPE_IO, RTTHREADFLAGS_WAITABLE, "USBISOC");
  • trunk/src/VBox/Devices/USB/VUSBUrb.cpp

    r45755 r46806  
    990990    PVUSBDEV pDev = pUrb->VUsb.pDev;
    991991    PVUSBROOTHUB pRh = vusbDevGetRh(pDev);
     992    AssertPtrReturn(pRh, VERR_VUSB_DEVICE_NOT_ATTACHED);
    992993    LogFlow(("%s: vusbUrbErrorRh: pDev=%p[%s] rh=%p\n", pUrb->pszDesc, pDev, pDev->pUsbIns ? pDev->pUsbIns->pszName : "", pRh));
    993994    return pRh->pIRhPort->pfnXferError(pRh->pIRhPort, pUrb);
     
    10121013     */
    10131014    PVUSBROOTHUB pRh = vusbDevGetRh(pUrb->VUsb.pDev);
     1015    AssertPtrReturnVoid(pRh);
    10141016    if (pUrb->enmType != VUSBXFERTYPE_MSG)
    10151017    {
     
    11151117#ifndef VBOX_WITH_STATISTICS
    11161118    PVUSBROOTHUB pRh = vusbDevGetRh(pUrb->VUsb.pDev);
     1119    AssertPtrReturnVoid(pRh);
    11171120#endif
    11181121
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