mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
ips/dma: fix memory leak in libxil code by explicitly calling free on
CyclicBd Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
This commit is contained in:
parent
b0ccbddc6f
commit
1bb6c221f6
1 changed files with 12 additions and 0 deletions
|
@ -201,6 +201,18 @@ Dma::~Dma() {
|
|||
// Unmap memory in our ownership, MemoryBlock gets deleted and removed from
|
||||
// graph by this destructor as well.
|
||||
if (hasScatterGather()) {
|
||||
// Fix memory leak in upstream Xilinx code
|
||||
auto txRingPtr = XAxiDma_GetTxRing(&xDma);
|
||||
auto rxRingPtr = XAxiDma_GetRxRing(&xDma);
|
||||
if (txRingPtr) {
|
||||
free(txRingPtr->CyclicBd);
|
||||
txRingPtr->CyclicBd = nullptr;
|
||||
}
|
||||
if (rxRingPtr) {
|
||||
free(rxRingPtr->CyclicBd);
|
||||
rxRingPtr->CyclicBd = nullptr;
|
||||
}
|
||||
// unampe SG memory Blocks
|
||||
if (sgRingTx) {
|
||||
card->unmapMemoryBlock(*sgRingTx);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue