VirtualBox

Changeset 104588 in vbox


Ignore:
Timestamp:
May 13, 2024 12:14:03 PM (7 months ago)
Author:
vboxsync
Message:

Devices/Security/DevTpm.cpp: Return if pfnSSMGetStructEx() fails, don't call pfnGetBufferSize() twice in RT_MIN() (harmless as pfnGetBufferSize() has no side effects), bugref:3409

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Security/DevTpm.cpp

    r102998 r104588  
    15961596    {
    15971597        rc = pHlp->pfnSSMGetStructEx(pSSM, pThis, sizeof(*pThis), 0 /*fFlags*/, &g_aTpmFields[0], NULL);
     1598        AssertRCReturn(rc, rc);
    15981599
    15991600        /* The marker. */
     
    17481749        AssertLogRelMsgReturn(pThisCC->pDrvTpm, ("TPM#%d: Driver is missing the TPM interface.\n", iInstance), VERR_PDM_MISSING_INTERFACE);
    17491750
    1750         pThis->cbCmdResp     = RT_MIN(pThisCC->pDrvTpm->pfnGetBufferSize(pThisCC->pDrvTpm), TPM_DATA_BUFFER_SIZE_MAX);
     1751        size_t cbBufDrv = pThisCC->pDrvTpm->pfnGetBufferSize(pThisCC->pDrvTpm);
     1752        pThis->cbCmdResp     = RT_MIN(cbBufDrv, TPM_DATA_BUFFER_SIZE_MAX);
    17511753        pThis->fLocChangeSup = pThisCC->pDrvTpm->pfnGetLocalityMax(pThisCC->pDrvTpm) > 0;
    17521754
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