From: Ivan Khoronzhuk Date: Tue, 8 Nov 2016 13:16:05 +0000 (+0200) Subject: net: ethernet: ti: davinci_cpdma: free memory while channel destroy X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b602e491a518439abd98a25ccded85e1347b9a14;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git net: ethernet: ti: davinci_cpdma: free memory while channel destroy 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 Reviewed-by: Grygorii Strashko Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/ti/davinci_cpdma.c b/drivers/net/ethernet/ti/davinci_cpdma.c index c3f35f11a8fd..8f7b42053bbb 100644 --- a/drivers/net/ethernet/ti/davinci_cpdma.c +++ b/drivers/net/ethernet/ti/davinci_cpdma.c @@ -533,7 +533,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);