VirtualBox

Changeset 24282 in vbox for trunk/src/VBox/VMM/PDMDevHlp.cpp


Ignore:
Timestamp:
Nov 3, 2009 10:14:35 AM (15 years ago)
Author:
vboxsync
Message:

PDM: Added missing driver instance checks.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/PDMDevHlp.cpp

    r24141 r24282  
    847847     */
    848848    int rc;
    849     char szNode[48];
    850     RTStrPrintf(szNode, sizeof(szNode), "LUN#%d", iLun);
    851     PCFGMNODE   pNode = CFGMR3GetChild(pDevIns->Internal.s.pCfgHandle, szNode);
     849    PCFGMNODE pNode = CFGMR3GetChildF(pDevIns->Internal.s.pCfgHandle, "LUN#%u", iLun);
    852850    if (pNode)
    853851    {
     
    860858             */
    861859            PPDMDRV pDrv = pdmR3DrvLookup(pVM, pszName);
    862             if (pDrv)
     860            if (    pDrv
     861                &&  pDrv->cInstances < pDrv->pDrvReg->cMaxInstances)
    863862            {
    864863                /* config node */
     
    930929                else
    931930                    AssertMsgFailed(("Failed to create Config node! rc=%Rrc\n", rc));
     931            }
     932            else if (pDrv)
     933            {
     934                AssertMsgFailed(("Too many instances of driver '%s', max is %u\n", pszName, pDrv->pDrvReg->cMaxInstances));
     935                rc = VERR_PDM_TOO_MANY_DRIVER_INSTANCES;
    932936            }
    933937            else
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