VirtualBox

Changeset 81815 in vbox for trunk/src/VBox/Devices/VirtIO


Ignore:
Timestamp:
Nov 12, 2019 6:46:14 PM (5 years ago)
Author:
vboxsync
Message:

Storage/DevVirtioSCSI.cpp: Fix burn caused by casting error that didn't err out on my local Linux build

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/VirtIO/Virtio_1_0.cpp

    r81814 r81815  
    597597    PVIRTQSTATE pVirtq  = &pVirtio->virtqState[idxQueue];
    598598
    599     PVIRTIOSGSEG paSegsIn = (PVIRTIOSGSEG)RTMemAlloc(VIRTQ_MAX_SIZE * sizeof(VIRTIOSGSEG));
     599    PCVIRTIOSGSEG paSegsIn = (PVIRTIOSGSEG)RTMemAlloc(VIRTQ_MAX_SIZE * sizeof(VIRTIOSGSEG));
    600600    AssertReturn(paSegsIn, VERR_NO_MEMORY);
    601601
    602     PVIRTIOSGSEG paSegsOut = (PVIRTIOSGSEG)RTMemAlloc(VIRTQ_MAX_SIZE * sizeof(VIRTIOSGSEG));
     602    PCVIRTIOSGSEG paSegsOut = (PVIRTIOSGSEG)RTMemAlloc(VIRTQ_MAX_SIZE * sizeof(VIRTIOSGSEG));
    603603    AssertReturn(paSegsOut, VERR_NO_MEMORY);
    604604
     
    652652            Log3Func(("%s IN  desc_idx=%u seg=%u addr=%RGp cb=%u\n", QUEUE_NAME(pVirtio, idxQueue), uDescIdx, cSegsIn, desc.GCPhysBuf, desc.cb));
    653653            cbIn += desc.cb;
    654             pSeg = &(paSegsIn[cSegsIn++]);
     654            pSeg = (PVIRTIOSGSEG)&(paSegsIn[cSegsIn++]);
    655655        }
    656656        else
     
    658658            Log3Func(("%s OUT desc_idx=%u seg=%u addr=%RGp cb=%u\n", QUEUE_NAME(pVirtio, idxQueue), uDescIdx, cSegsOut, desc.GCPhysBuf, desc.cb));
    659659            cbOut += desc.cb;
    660             pSeg = &(paSegsOut[cSegsOut++]);
     660            pSeg = (PVIRTIOSGSEG)&(paSegsOut[cSegsOut++]);
    661661        }
    662662
     
    670670    AssertReturn(pSgPhysIn, VERR_NO_MEMORY);
    671671
    672     virtioCoreSgBufInit(pSgPhysIn, (PCVIRTIOSGSEG)paSegsIn, cSegsIn);
     672    virtioCoreSgBufInit(pSgPhysIn, paSegsIn, cSegsIn);
    673673
    674674    PVIRTIOSGBUF pSgPhysOut = (PVIRTIOSGBUF)RTMemAllocZ(sizeof(VIRTIOSGBUF));
    675675    AssertReturn(pSgPhysOut, VERR_NO_MEMORY);
    676676
    677     virtioCoreSgBufInit(pSgPhysOut, (PCVIRTIOSGSEG)paSegsOut, cSegsOut);
     677    virtioCoreSgBufInit(pSgPhysOut, paSegsOut, cSegsOut);
    678678
    679679    PVIRTIO_DESC_CHAIN_T pDescChain = (PVIRTIO_DESC_CHAIN_T)RTMemAllocZ(sizeof(VIRTIO_DESC_CHAIN_T));
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