SWDEV-556877 - Ensure pinned memory is released if hsa copy fails (#1137)

Cette révision appartient à :
Ioannis Assiouras
2025-10-14 10:08:49 +01:00
révisé par GitHub
Parent 092279449e
révision 538ebc5409
+4
Voir le fichier
@@ -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;
}
}