VirtualBox

Changeset 27686 in vbox for trunk/src/VBox/Devices/USB


Ignore:
Timestamp:
Mar 24, 2010 9:00:35 PM (15 years ago)
Author:
vboxsync
Message:

DevOHCI: fixed segfault in rhport_set_if_connected()

File:
1 edited

Legend:

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

    r27290 r27686  
    45244524#endif
    45254525
    4526 
    45274526    /* Write to clear any of the change bits: CSC, PESC, PSSC, OCIC and PRSC */
    4528     if ( val & OHCI_PORT_W_CLEAR_CHANGE_MASK )
     4527    if (val & OHCI_PORT_W_CLEAR_CHANGE_MASK)
    45294528        p->fReg &= ~(val & OHCI_PORT_W_CLEAR_CHANGE_MASK);
    45304529
    4531     if ( val & OHCI_PORT_W_CLEAR_ENABLE )
     4530    if (val & OHCI_PORT_W_CLEAR_ENABLE)
    45324531    {
    45334532        p->fReg &= ~OHCI_PORT_R_ENABLE_STATUS;
     
    45354534    }
    45364535
    4537     if ( rhport_set_if_connected(&pOhci->RootHub, i, val & OHCI_PORT_W_SET_ENABLE) )
     4536    if (rhport_set_if_connected(&pOhci->RootHub, i, val & OHCI_PORT_W_SET_ENABLE))
    45384537        Log2(("HcRhPortStatus_w(): port %u: ENABLE\n", i));
    45394538
    4540     if ( rhport_set_if_connected(&pOhci->RootHub, i, val & OHCI_PORT_W_SET_SUSPEND) )
     4539    if (rhport_set_if_connected(&pOhci->RootHub, i, val & OHCI_PORT_W_SET_SUSPEND))
    45414540        Log2(("HcRhPortStatus_w(): port %u: SUSPEND - not implemented correctly!!!\n", i));
    45424541
    4543     if (val & OHCI_PORT_W_SET_RESET) {
    4544         if ( rhport_set_if_connected(&pOhci->RootHub, i, val & OHCI_PORT_W_SET_RESET) )
     4542    if (val & OHCI_PORT_W_SET_RESET)
     4543    {
     4544        if (rhport_set_if_connected(&pOhci->RootHub, i, val & OHCI_PORT_W_SET_RESET))
    45454545        {
    45464546            PVM pVM = PDMDevHlpGetVM(pOhci->CTX_SUFF(pDevIns));
     
    45484548            VUSBIDevReset(p->pDev, false /* don't reset on linux */, uchi_port_reset_done, pOhci, pVM);
    45494549        }
    4550         else if ( p->fReg & OHCI_PORT_R_RESET_STATUS )
     4550        else if (p->fReg & OHCI_PORT_R_RESET_STATUS)
    45514551        {
    45524552            /* the guest is getting impatient. */
     
    45564556    }
    45574557
    4558     if ( !(pOhci->RootHub.desc_a & OHCI_RHA_NPS) )
     4558    if (!(pOhci->RootHub.desc_a & OHCI_RHA_NPS))
    45594559    {
    45604560        /** @todo To implement per-device power-switching
     
    45624562         * sure it isn't gang powered
    45634563         */
    4564         if ( val & OHCI_PORT_W_CLEAR_POWER )
     4564        if (val & OHCI_PORT_W_CLEAR_POWER)
    45654565            rhport_power(&pOhci->RootHub, i, false /* power down */);
    4566         if ( val & OHCI_PORT_W_SET_POWER )
     4566        if (val & OHCI_PORT_W_SET_POWER)
    45674567            rhport_power(&pOhci->RootHub, i, true /* power up */);
    45684568    }
    45694569
    45704570    /** @todo r=frank:  ClearSuspendStatus. Timing? */
    4571     if ( val & OHCI_PORT_W_CLEAR_SUSPEND_STATUS )
     4571    if (val & OHCI_PORT_W_CLEAR_SUSPEND_STATUS)
    45724572    {
    45734573        rhport_power(&pOhci->RootHub, i, true /* power up */);
     
    45764576    }
    45774577
    4578     if ( p->fReg != old_state )
     4578    if (p->fReg != old_state)
    45794579    {
    45804580        uint32_t res = p->fReg;
     
    52805280    pOhci->PciDev.config[0x0b] = 0xc;
    52815281    pOhci->PciDev.config[0x3d] = 0x01;
     5282    pOhci->RootHub.pOhci                         = pOhci;
    52825283    pOhci->RootHub.IBase.pfnQueryInterface       = ohciRhQueryInterface;
    52835284    pOhci->RootHub.IRhPort.pfnGetAvailablePorts  = ohciRhGetAvailablePorts;
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