dmaengine Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] dmaengine: pl330: use the same attributes when freeing pl330->mcode_cpu
@ 2019-07-26 10:59 Fuqian Huang
  2019-08-08 13:19 ` Vinod Koul
  0 siblings, 1 reply; 2+ messages in thread
From: Fuqian Huang @ 2019-07-26 10:59 UTC (permalink / raw)
  To: unlisted-recipients:; (no To-header on input)
  Cc: Vinod Koul, dmaengine, linux-kernel, Fuqian Huang

In function dmac_alloc_resources(), pl330->mcode_cpu is allocated using
dma_alloc_attrs() but freed with dma_free_coherent().
Use the correct dma_free_attrs() function to free pl330->mcode_cpu.

Signed-off-by: Fuqian Huang <huangfq.daxian@gmail.com>
---
 drivers/dma/pl330.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
index 1163af2ba4a3..6cce9ef61b29 100644
--- a/drivers/dma/pl330.c
+++ b/drivers/dma/pl330.c
@@ -1922,9 +1922,10 @@ static int dmac_alloc_resources(struct pl330_dmac *pl330)
 	if (ret) {
 		dev_err(pl330->ddma.dev, "%s:%d Can't to create channels for DMAC!\n",
 			__func__, __LINE__);
-		dma_free_coherent(pl330->ddma.dev,
+		dma_free_attrs(pl330->ddma.dev,
 				chans * pl330->mcbufsz,
-				pl330->mcode_cpu, pl330->mcode_bus);
+				pl330->mcode_cpu, pl330->mcode_bus,
+				DMA_ATTR_PRIVILEGED);
 		return ret;
 	}
 
@@ -2003,9 +2004,9 @@ static void pl330_del(struct pl330_dmac *pl330)
 	/* Free DMAC resources */
 	dmac_free_threads(pl330);
 
-	dma_free_coherent(pl330->ddma.dev,
+	dma_free_attrs(pl330->ddma.dev,
 		pl330->pcfg.num_chan * pl330->mcbufsz, pl330->mcode_cpu,
-		pl330->mcode_bus);
+		pl330->mcode_bus, DMA_ATTR_PRIVILEGED);
 }
 
 /* forward declaration */
-- 
2.11.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] dmaengine: pl330: use the same attributes when freeing pl330->mcode_cpu
  2019-07-26 10:59 [PATCH] dmaengine: pl330: use the same attributes when freeing pl330->mcode_cpu Fuqian Huang
@ 2019-08-08 13:19 ` Vinod Koul
  0 siblings, 0 replies; 2+ messages in thread
From: Vinod Koul @ 2019-08-08 13:19 UTC (permalink / raw)
  To: Fuqian Huang; +Cc: dmaengine, linux-kernel

On 26-07-19, 18:59, Fuqian Huang wrote:
> In function dmac_alloc_resources(), pl330->mcode_cpu is allocated using
> dma_alloc_attrs() but freed with dma_free_coherent().
> Use the correct dma_free_attrs() function to free pl330->mcode_cpu.

Applied, thanks

-- 
~Vinod

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-26 10:59 [PATCH] dmaengine: pl330: use the same attributes when freeing pl330->mcode_cpu Fuqian Huang
2019-08-08 13:19 ` Vinod Koul

dmaengine Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/dmaengine/0 dmaengine/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dmaengine dmaengine/ https://lore.kernel.org/dmaengine \
		dmaengine@vger.kernel.org dmaengine@archiver.kernel.org
	public-inbox-index dmaengine


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.dmaengine


AGPL code for this site: git clone https://public-inbox.org/ public-inbox