diff mbox

dma driver: fix potential oom issue of fsldma

Message ID 1450941981-11900-1-git-send-email-xuelin.shi@nxp.com (mailing list archive)
State Not Applicable
Headers show

Commit Message

Xuelin Shi Dec. 24, 2015, 7:26 a.m. UTC
From: Xuelin Shi <xuelin.shi@freescale.com>

missing unmap sources and destinations while doing dequeue.

Signed-off-by: Xuelin Shi <xuelin.shi@nxp.com>
---
 drivers/dma/fsldma.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Yang Li March 7, 2016, 11:47 p.m. UTC | #1
The change looks to be correct.  But we need better formatting and description.

Make the title something like:

dmaengine: fsldma: fix memory leak

On Thu, Dec 24, 2015 at 1:26 AM, Xuelin Shi <xuelin.shi@nxp.com> wrote:
> From: Xuelin Shi <xuelin.shi@freescale.com>
>
> missing unmap sources and destinations while doing dequeue.

How can this describe your change?

Regards,
Leo
>
> Signed-off-by: Xuelin Shi <xuelin.shi@nxp.com>
> ---
>  drivers/dma/fsldma.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/dma/fsldma.c b/drivers/dma/fsldma.c
> index 2209f75..aac85c3 100644
> --- a/drivers/dma/fsldma.c
> +++ b/drivers/dma/fsldma.c
> @@ -522,6 +522,8 @@ static dma_cookie_t fsldma_run_tx_complete_actions(struct fsldma_chan *chan,
>                         chan_dbg(chan, "LD %p callback\n", desc);
>                         txd->callback(txd->callback_param);
>                 }
> +
> +               dma_descriptor_unmap(txd);
>         }
>
>         /* Run any dependencies */
> --
> 1.8.4
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev
Yang Li March 7, 2016, 11:49 p.m. UTC | #2
On Thu, Dec 24, 2015 at 1:26 AM, Xuelin Shi <xuelin.shi@nxp.com> wrote:
> From: Xuelin Shi <xuelin.shi@freescale.com>

And please cc dmaengine maintainers and its mailing list when you send
next version.

>
> missing unmap sources and destinations while doing dequeue.
>
> Signed-off-by: Xuelin Shi <xuelin.shi@nxp.com>
> ---
>  drivers/dma/fsldma.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/dma/fsldma.c b/drivers/dma/fsldma.c
> index 2209f75..aac85c3 100644
> --- a/drivers/dma/fsldma.c
> +++ b/drivers/dma/fsldma.c
> @@ -522,6 +522,8 @@ static dma_cookie_t fsldma_run_tx_complete_actions(struct fsldma_chan *chan,
>                         chan_dbg(chan, "LD %p callback\n", desc);
>                         txd->callback(txd->callback_param);
>                 }
> +
> +               dma_descriptor_unmap(txd);
>         }
>
>         /* Run any dependencies */
> --
> 1.8.4
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev
diff mbox

Patch

diff --git a/drivers/dma/fsldma.c b/drivers/dma/fsldma.c
index 2209f75..aac85c3 100644
--- a/drivers/dma/fsldma.c
+++ b/drivers/dma/fsldma.c
@@ -522,6 +522,8 @@  static dma_cookie_t fsldma_run_tx_complete_actions(struct fsldma_chan *chan,
 			chan_dbg(chan, "LD %p callback\n", desc);
 			txd->callback(txd->callback_param);
 		}
+
+		dma_descriptor_unmap(txd);
 	}
 
 	/* Run any dependencies */