aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/dma/at_hdmac.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c
index 7cbac6e8c113..01d936c9fe89 100644
--- a/drivers/dma/at_hdmac.c
+++ b/drivers/dma/at_hdmac.c
@@ -1641,6 +1641,12 @@ static void atc_free_chan_resources(struct dma_chan *chan)
1641 atchan->descs_allocated = 0; 1641 atchan->descs_allocated = 0;
1642 atchan->status = 0; 1642 atchan->status = 0;
1643 1643
1644 /*
1645 * Free atslave allocated in at_dma_xlate()
1646 */
1647 kfree(chan->private);
1648 chan->private = NULL;
1649
1644 dev_vdbg(chan2dev(chan), "free_chan_resources: done\n"); 1650 dev_vdbg(chan2dev(chan), "free_chan_resources: done\n");
1645} 1651}
1646 1652
@@ -1675,7 +1681,7 @@ static struct dma_chan *at_dma_xlate(struct of_phandle_args *dma_spec,
1675 dma_cap_zero(mask); 1681 dma_cap_zero(mask);
1676 dma_cap_set(DMA_SLAVE, mask); 1682 dma_cap_set(DMA_SLAVE, mask);
1677 1683
1678 atslave = devm_kzalloc(&dmac_pdev->dev, sizeof(*atslave), GFP_KERNEL); 1684 atslave = kzalloc(sizeof(*atslave), GFP_KERNEL);
1679 if (!atslave) 1685 if (!atslave)
1680 return NULL; 1686 return NULL;
1681 1687
@@ -2000,6 +2006,8 @@ static int at_dma_remove(struct platform_device *pdev)
2000 struct resource *io; 2006 struct resource *io;
2001 2007
2002 at_dma_off(atdma); 2008 at_dma_off(atdma);
2009 if (pdev->dev.of_node)
2010 of_dma_controller_free(pdev->dev.of_node);
2003 dma_async_device_unregister(&atdma->dma_common); 2011 dma_async_device_unregister(&atdma->dma_common);
2004 2012
2005 dma_pool_destroy(atdma->memset_pool); 2013 dma_pool_destroy(atdma->memset_pool);