VirtualBox

Changeset 87726 in vbox


Ignore:
Timestamp:
Feb 11, 2021 9:29:13 PM (4 years ago)
Author:
vboxsync
Message:

Devices/Serial/UartCore: Fix lock order violation when in disconnected mode

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Serial/UartCore.cpp

    r84908 r87726  
    859859    if (fNotifyDrv)
    860860    {
     861        /* Leave the device critical section before calling into the lower driver. */
     862        PDMDevHlpCritSectLeave(pDevIns, &pThis->CritSect);
     863
    861864        if (   pThisCC->pDrvSerial
    862865            && !(pThis->uRegMcr & UART_REG_MCR_LOOP))
    863866        {
    864             /* Leave the device critical section before calling into the lower driver. */
    865             PDMDevHlpCritSectLeave(pDevIns, &pThis->CritSect);
    866867            int rc2 = pThisCC->pDrvSerial->pfnDataAvailWrNotify(pThisCC->pDrvSerial);
    867868            if (RT_FAILURE(rc2))
    868869                LogRelMax(10, ("Serial#%d: Failed to send data with %Rrc\n", pDevIns->iInstance, rc2));
    869             PDMDevHlpCritSectEnter(pDevIns, &pThis->CritSect, VINF_SUCCESS);
    870870        }
    871871        else
    872872            PDMDevHlpTimerSetRelative(pDevIns, pThis->hTimerTxUnconnected, pThis->cSymbolXferTicks, NULL);
     873
     874        PDMDevHlpCritSectEnter(pDevIns, &pThis->CritSect, VINF_SUCCESS);
    873875    }
    874876#endif
     
    14171419                break;
    14181420            case UART_REG_SCR_INDEX:
    1419                 pThis->uRegScr = u32;
     1421                pThis->uRegScr = uVal;
    14201422                break;
    14211423            default:
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