summaryrefslogtreecommitdiffstats
path: root/drivers/dma/at_hdmac.c
diff options
context:
space:
mode:
authorYu Kuai <yukuai3@huawei.com>2020-08-17 13:57:28 +0200
committerVinod Koul <vkoul@kernel.org>2020-08-19 06:28:38 +0200
commite097eb7473d9e70da9e03276f61cd392ccb9d79f (patch)
tree1047a4e5bb966d1efd0e13c1bad92ebb9024a2cf /drivers/dma/at_hdmac.c
parentdmaengine: at_hdmac: add missing put_device() call in at_dma_xlate() (diff)
downloadlinux-e097eb7473d9e70da9e03276f61cd392ccb9d79f.tar.xz
linux-e097eb7473d9e70da9e03276f61cd392ccb9d79f.zip
dmaengine: at_hdmac: add missing kfree() call in at_dma_xlate()
If memory allocation for 'atslave' succeed, at_dma_xlate() doesn't have a corresponding kfree() in exception handling. Thus add kfree() for this function implementation. Fixes: bbe89c8e3d59 ("at_hdmac: move to generic DMA binding") Signed-off-by: Yu Kuai <yukuai3@huawei.com> Link: https://lore.kernel.org/r/20200817115728.1706719-4-yukuai3@huawei.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'drivers/dma/at_hdmac.c')
-rw-r--r--drivers/dma/at_hdmac.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c
index bf874367097c..a2cf25c6e3b3 100644
--- a/drivers/dma/at_hdmac.c
+++ b/drivers/dma/at_hdmac.c
@@ -1691,6 +1691,7 @@ static struct dma_chan *at_dma_xlate(struct of_phandle_args *dma_spec,
chan = dma_request_channel(mask, at_dma_filter, atslave);
if (!chan) {
put_device(&dmac_pdev->dev);
+ kfree(atslave);
return NULL;
}