VirtualBox

Ignore:
Timestamp:
Jul 5, 2017 3:48:20 PM (8 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
116730
Message:

Devices: when attaching a driver, don't pass a local variable as description

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Storage/DevLsiLogicSCSI.cpp

    r65648 r67806  
    55955595    for (unsigned i = 0; i < pThis->cDeviceStates; i++)
    55965596    {
    5597         char szName[24];
    55985597        PLSILOGICDEVICE pDevice = &pThis->paDeviceStates[i];
    55995598
     
    56135612        pDevice->ILed.pfnQueryStatusLed                  = lsilogicR3DeviceQueryStatusLed;
    56145613
    5615         RTStrPrintf(szName, sizeof(szName), "Device%u", i);
     5614        char *pszName;
     5615        if (RTStrAPrintf(&pszName, "Device%u", i) <= 0)
     5616            AssertLogRelFailedReturn(VERR_NO_MEMORY);
    56165617
    56175618        /* Attach SCSI driver. */
    5618         rc = PDMDevHlpDriverAttach(pDevIns, pDevice->iLUN, &pDevice->IBase, &pDevice->pDrvBase, szName);
     5619        rc = PDMDevHlpDriverAttach(pDevIns, pDevice->iLUN, &pDevice->IBase, &pDevice->pDrvBase, pszName);
    56195620        if (RT_SUCCESS(rc))
    56205621        {
     
    56415642            pDevice->pDrvBase = NULL;
    56425643            rc = VINF_SUCCESS;
    5643             Log(("LsiLogic: no driver attached to device %s\n", szName));
     5644            Log(("LsiLogic: no driver attached to device %s\n", pszName));
    56445645        }
    56455646        else
    56465647        {
    5647             AssertLogRelMsgFailed(("LsiLogic: Failed to attach %s\n", szName));
     5648            AssertLogRelMsgFailed(("LsiLogic: Failed to attach %s\n", pszName));
    56485649            return rc;
    56495650        }
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette