Skip to content

Commit 3aa58cb

Browse files
tititiou36vinodkoul
authored andcommitted
dmaengine: fsl-qdma: Fix a memory leak related to the queue command DMA
This dma_alloc_coherent() is undone neither in the remove function, nor in the error handling path of fsl_qdma_probe(). Switch to the managed version to fix both issues. Fixes: b092529 ("dmaengine: fsl-qdma: Add qDMA controller driver for Layerscape SoCs") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Link: https://lore.kernel.org/r/7f66aa14f59d32b13672dde28602b47deb294e1f.1704621515.git.christophe.jaillet@wanadoo.fr Signed-off-by: Vinod Koul <vkoul@kernel.org>
1 parent 968bc1d commit 3aa58cb

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

drivers/dma/fsl-qdma.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -514,11 +514,11 @@ static struct fsl_qdma_queue
514514
queue_temp = queue_head + i + (j * queue_num);
515515

516516
queue_temp->cq =
517-
dma_alloc_coherent(&pdev->dev,
518-
sizeof(struct fsl_qdma_format) *
519-
queue_size[i],
520-
&queue_temp->bus_addr,
521-
GFP_KERNEL);
517+
dmam_alloc_coherent(&pdev->dev,
518+
sizeof(struct fsl_qdma_format) *
519+
queue_size[i],
520+
&queue_temp->bus_addr,
521+
GFP_KERNEL);
522522
if (!queue_temp->cq)
523523
return NULL;
524524
queue_temp->block_base = fsl_qdma->block_base +

0 commit comments

Comments
 (0)