linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: ethernet: ti: davinci_cpdma: free memory while channel destroy
@ 2016-11-08 13:16 Ivan Khoronzhuk
  2016-11-08 23:22 ` Grygorii Strashko
  2016-11-13  2:07 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Ivan Khoronzhuk @ 2016-11-08 13:16 UTC (permalink / raw)
  To: mugunthanvnm, grygorii.strashko, netdev
  Cc: linux-omap, linux-kernel, Ivan Khoronzhuk

While create/destroy channel operation memory is not freed. It was
supposed that memory is freed while driver remove. But a channel
can be created and destroyed many times while changing number of
channels with ethtool.

Based on net-next/master

Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
---
 drivers/net/ethernet/ti/davinci_cpdma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/ti/davinci_cpdma.c b/drivers/net/ethernet/ti/davinci_cpdma.c
index 05afc05..07fc92d 100644
--- a/drivers/net/ethernet/ti/davinci_cpdma.c
+++ b/drivers/net/ethernet/ti/davinci_cpdma.c
@@ -586,7 +586,7 @@ int cpdma_chan_destroy(struct cpdma_chan *chan)
 		cpdma_chan_stop(chan);
 	ctlr->channels[chan->chan_num] = NULL;
 	ctlr->chan_num--;
-
+	devm_kfree(ctlr->dev, chan);
 	cpdma_chan_split_pool(ctlr);
 
 	spin_unlock_irqrestore(&ctlr->lock, flags);
-- 
1.9.1

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

* Re: [PATCH] net: ethernet: ti: davinci_cpdma: free memory while channel destroy
  2016-11-08 13:16 [PATCH] net: ethernet: ti: davinci_cpdma: free memory while channel destroy Ivan Khoronzhuk
@ 2016-11-08 23:22 ` Grygorii Strashko
  2016-11-13  2:07 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Grygorii Strashko @ 2016-11-08 23:22 UTC (permalink / raw)
  To: Ivan Khoronzhuk, mugunthanvnm, netdev; +Cc: linux-omap, linux-kernel



On 11/08/2016 07:16 AM, Ivan Khoronzhuk wrote:
> While create/destroy channel operation memory is not freed. It was
> supposed that memory is freed while driver remove. But a channel
> can be created and destroyed many times while changing number of
> channels with ethtool.
>
> Based on net-next/master

^?

>
> Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>

Reviewed-by: Grygorii Strashko <grygorii.strashko@ti.com>

> ---
>  drivers/net/ethernet/ti/davinci_cpdma.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/ti/davinci_cpdma.c b/drivers/net/ethernet/ti/davinci_cpdma.c
> index 05afc05..07fc92d 100644
> --- a/drivers/net/ethernet/ti/davinci_cpdma.c
> +++ b/drivers/net/ethernet/ti/davinci_cpdma.c
> @@ -586,7 +586,7 @@ int cpdma_chan_destroy(struct cpdma_chan *chan)
>  		cpdma_chan_stop(chan);
>  	ctlr->channels[chan->chan_num] = NULL;
>  	ctlr->chan_num--;
> -
> +	devm_kfree(ctlr->dev, chan);
>  	cpdma_chan_split_pool(ctlr);
>
>  	spin_unlock_irqrestore(&ctlr->lock, flags);
>

-- 
regards,
-grygorii

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

* Re: [PATCH] net: ethernet: ti: davinci_cpdma: free memory while channel destroy
  2016-11-08 13:16 [PATCH] net: ethernet: ti: davinci_cpdma: free memory while channel destroy Ivan Khoronzhuk
  2016-11-08 23:22 ` Grygorii Strashko
@ 2016-11-13  2:07 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2016-11-13  2:07 UTC (permalink / raw)
  To: ivan.khoronzhuk
  Cc: mugunthanvnm, grygorii.strashko, netdev, linux-omap, linux-kernel

From: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
Date: Tue,  8 Nov 2016 15:16:05 +0200

> While create/destroy channel operation memory is not freed. It was
> supposed that memory is freed while driver remove. But a channel
> can be created and destroyed many times while changing number of
> channels with ethtool.
> 
> Based on net-next/master
> 
> Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>

Applied.

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

end of thread, other threads:[~2016-11-13  2:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-08 13:16 [PATCH] net: ethernet: ti: davinci_cpdma: free memory while channel destroy Ivan Khoronzhuk
2016-11-08 23:22 ` Grygorii Strashko
2016-11-13  2:07 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).