VirtualBox

Changeset 90447 in vbox for trunk/src/VBox/Devices/Audio


Ignore:
Timestamp:
Jul 31, 2021 12:44:13 AM (3 years ago)
Author:
vboxsync
Message:

Dev*: Checked up all the PDMDevHlpCritSectEnter calls to make sure the status code is checked. bugref:6695

Location:
trunk/src/VBox/Devices/Audio
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Audio/DevHda.cpp

    r90331 r90447  
    8383#define DEVHDA_LOCK(a_pDevIns, a_pThis) \
    8484    do { \
    85         int rcLock = PDMDevHlpCritSectEnter((a_pDevIns), &(a_pThis)->CritSect, VERR_IGNORED); \
    86         AssertRC(rcLock); \
     85        int const rcLock = PDMDevHlpCritSectEnter((a_pDevIns), &(a_pThis)->CritSect, VERR_IGNORED); \
     86        PDM_CRITSECT_RELEASE_ASSERT_RC_DEV((a_pDevIns), &(a_pThis)->CritSect, rcLock); \
    8787    } while (0)
    8888
     
    9292#define DEVHDA_LOCK_RETURN(a_pDevIns, a_pThis, a_rcBusy) \
    9393    do { \
    94         int rcLock = PDMDevHlpCritSectEnter((a_pDevIns), &(a_pThis)->CritSect, a_rcBusy); \
     94        int const rcLock = PDMDevHlpCritSectEnter((a_pDevIns), &(a_pThis)->CritSect, a_rcBusy); \
    9595        if (rcLock == VINF_SUCCESS) \
    9696        { /* likely */ } \
     
    107107# define DEVHDA_LOCK_RETURN_VOID(a_pDevIns, a_pThis) \
    108108    do { \
    109         int rcLock = PDMDevHlpCritSectEnter((a_pDevIns), &(a_pThis)->CritSect, VERR_IGNORED); \
     109        int const rcLock = PDMDevHlpCritSectEnter((a_pDevIns), &(a_pThis)->CritSect, VERR_IGNORED); \
    110110        if (rcLock == VINF_SUCCESS) \
    111111        { /* likely */ } \
    112112        else \
    113113        { \
    114             AssertRC(rcLock); \
     114            PDM_CRITSECT_RELEASE_ASSERT_RC_DEV((a_pDevIns), &(a_pThis)->CritSect, rcLock); \
    115115            return; \
    116116        } \
     
    40814081                            RT_ZERO(StreamDummyShared); RT_ZERO(StreamDummyR3));
    40824082
    4083         PDMDevHlpCritSectEnter(pDevIns, &pThis->CritSect, VERR_IGNORED); /* timer code requires this */
     4083        rc = PDMDevHlpCritSectEnter(pDevIns, &pThis->CritSect, VERR_IGNORED); /* timer code requires this */
     4084        AssertRCReturn(rc, rc);
    40844085        rc = hdaR3StreamSetUp(pDevIns, pThis, pStreamShared, pStreamR3, idStream);
    40854086        PDMDevHlpCritSectLeave(pDevIns, &pThis->CritSect);
     
    47534754
    47544755    if (PDMDevHlpCritSectIsInitialized(pDevIns, &pThis->CritSect))
    4755         PDMDevHlpCritSectEnter(pDevIns, &pThis->CritSect, VERR_IGNORED);
     4756        (void)PDMDevHlpCritSectEnter(pDevIns, &pThis->CritSect, VERR_IGNORED);
    47564757
    47574758    PHDADRIVER pDrv;
  • trunk/src/VBox/Devices/Audio/DevIchAc97.cpp

    r90247 r90447  
    640640#define DEVAC97_LOCK(a_pDevIns, a_pThis) \
    641641    do { \
    642         int rcLock = PDMDevHlpCritSectEnter((a_pDevIns), &(a_pThis)->CritSect, VERR_IGNORED); \
    643         AssertRC(rcLock); \
     642        int const rcLock = PDMDevHlpCritSectEnter((a_pDevIns), &(a_pThis)->CritSect, VERR_IGNORED); \
     643        PDM_CRITSECT_RELEASE_ASSERT_RC_DEV((a_pDevIns), &(a_pThis)->CritSect, rcLock); \
    644644    } while (0)
    645645
     
    651651        int rcLock = PDMDevHlpCritSectEnter((a_pDevIns), &(a_pThis)->CritSect, a_rcBusy); \
    652652        if (rcLock == VINF_SUCCESS) \
    653             break; \
    654         AssertRC(rcLock); \
    655         return rcLock; \
     653        { /* likely */ } \
     654        else \
     655        { \
     656            AssertRC(rcLock); \
     657            return rcLock; \
     658        } \
    656659    } while (0)
    657660
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