SWDEV-556877 - Ensure pinned memory is released if hsa copy fails (#1137)
Cette révision appartient à :
révisé par
GitHub
Parent
092279449e
révision
538ebc5409
@@ -729,6 +729,8 @@ bool DmaBlitManager::hsaCopyStagedOrPinned(const_address hostSrc, address hostDs
|
||||
address dst = hostDst + copyOffset;
|
||||
status = rocrCopyBuffer(dst, dstAgent, stagingBuffer, srcAgent, copysize, copyMetadata);
|
||||
if (!status) {
|
||||
// Release Pinned Memory back to pool if any
|
||||
releaseBuffer(outBuffer);
|
||||
break;
|
||||
}
|
||||
} else { // D2H Path
|
||||
@@ -745,6 +747,8 @@ bool DmaBlitManager::hsaCopyStagedOrPinned(const_address hostSrc, address hostDs
|
||||
memcpy(hostDst + copyOffset, stagingBuffer, copysize);
|
||||
}
|
||||
} else {
|
||||
// Release Pinned Memory back to pool if any
|
||||
releaseBuffer(outBuffer);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Référencer dans un nouveau ticket
Bloquer un utilisateur