VirtualBox

Changeset 64658 in vbox for trunk/src


Ignore:
Timestamp:
Nov 14, 2016 2:18:44 PM (8 years ago)
Author:
vboxsync
Message:

AHCI: Fix calculation of transfered data size

File:
1 edited

Legend:

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

    r64408 r64658  
    37693769            /* Write updated command header into memory of the guest. */
    37703770            uint32_t u32PRDBC = 0;
    3771             if (pAhciReq->enmType!= PDMMEDIAEXIOREQTYPE_INVALID)
     3771            if (pAhciReq->enmType != PDMMEDIAEXIOREQTYPE_INVALID)
    37723772            {
    37733773                size_t cbXfer = 0;
    3774                 size_t cbResidual = 0;
    37753774                int rc = pAhciPort->pDrvMediaEx->pfnIoReqQueryXferSize(pAhciPort->pDrvMediaEx, pAhciReq->hIoReq, &cbXfer);
    37763775                AssertRC(rc);
    3777                 rc = pAhciPort->pDrvMediaEx->pfnIoReqQueryResidual(pAhciPort->pDrvMediaEx, pAhciReq->hIoReq, &cbResidual);
    3778                 AssertRC(rc); Assert(cbXfer >= cbResidual);
    3779                 u32PRDBC = (uint32_t)(cbXfer - cbResidual);
     3776                u32PRDBC = (uint32_t)RT_MIN(cbXfer, pAhciReq->cbTransfer);
    37803777            }
    37813778            else
     
    38963893    if (pIoReq->fFlags & AHCI_REQ_OVERFLOW)
    38973894        rc = VERR_PDM_MEDIAEX_IOBUF_OVERFLOW;
    3898 
    3899     if (pIoReq->enmType == PDMMEDIAEXIOREQTYPE_SCSI)
    3900         pIoReq->cbTransfer += cbCopy;
    39013895
    39023896    return rc;
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