VirtualBox

Changeset 219 in vbox


Ignore:
Timestamp:
Jan 22, 2007 12:36:58 AM (18 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
17711
Message:

MALLOC (kalloc) fails on relativly small amounts, use IOMallocAliged then.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/Support/darwin/SUPDrv-darwin.c

    r216 r219  
    378378{
    379379    int                 rc;
     380    void               *pvPageBuf = NULL;
    380381    void               *pvBuf = NULL;
    381382    int                 cbBuf = 0;
     
    401402        MALLOC(pvBuf, void *, cbBuf, M_TEMP, M_WAITOK);
    402403        if (pvBuf == NULL)
     404            pvPageBuf = pvBuf = IOMallocAligned(cbBuf, 8);
     405        if (pvBuf == NULL)
    403406        {
    404407            dprintf(("VBoxSupDrvIOCtl: failed to allocate buffer of %d bytes.\n", cbBuf));
     
    409412        {
    410413            dprintf(("VBoxSupDrvIOCtl: copyin(%p,,%d) failed.\n", pArgs->pvIn, cbBuf));
    411             FREE(pvBuf, M_TEMP);
     414            if (pvPageBuf)
     415                IOFreeAligned(pvPageBuf, cbBuf);
     416            else
     417                FREE(pvBuf, M_TEMP);
    412418            return rc;
    413419        }
     
    447453    }
    448454
    449     if (pvBuf)
     455    if (pvPageBuf)
     456        IOFreeAligned(pvPageBuf, cbBuf);
     457    else if (pvBuf)
    450458        FREE(pvBuf, M_TEMP);
    451459
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