Skip to content

Commit 2f6d8fa

Browse files
geyslanVinod Koul
authored andcommitted
dma: edma.c: remove edma_desc leakage
Free memory allocated to edma_desc when failing to allocate slot. Signed-off-by: Geyslan G. Bem <[email protected]> Signed-off-by: Vinod Koul <[email protected]>
1 parent 08d08bc commit 2f6d8fa

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/dma/edma.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,7 @@ static struct dma_async_tx_descriptor *edma_prep_slave_sg(
306306
EDMA_SLOT_ANY);
307307
if (echan->slot[i] < 0) {
308308
dev_err(dev, "Failed to allocate slot\n");
309+
kfree(edesc);
309310
return NULL;
310311
}
311312
}

0 commit comments

Comments
 (0)