VirtualBox

Changeset 84908 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
Jun 22, 2020 2:49:46 PM (5 years ago)
Author:
vboxsync
Message:

Devices/UartCore: Make sure DR is only set after we've successfully read some data

File:
1 edited

Legend:

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

    r84907 r84908  
    15991599        size_t cbRead = 0;
    16001600        int rc = pThisCC->pDrvSerial->pfnReadRdr(pThisCC->pDrvSerial, &pThis->uRegRbr, 1, &cbRead);
    1601         AssertMsg(RT_SUCCESS(rc) && cbRead == 1, ("This shouldn't fail and always return one byte!\n")); RT_NOREF(rc);
    1602         UART_REG_SET(pThis->uRegLsr, UART_REG_LSR_DR);
    1603         uartIrqUpdate(pDevIns, pThis, pThisCC);
     1601        AssertRC(rc);
     1602
     1603        if (cbRead)
     1604        {
     1605            UART_REG_SET(pThis->uRegLsr, UART_REG_LSR_DR);
     1606            uartIrqUpdate(pDevIns, pThis, pThisCC);
     1607        }
    16041608    }
    16051609    PDMDevHlpCritSectLeave(pDevIns, &pThis->CritSect);
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