summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>2020-12-19 13:47:18 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-01-17 14:05:36 +0100
commitc15556cb344a6e8235393013e60a7e2648ec699e (patch)
tree2979c7b9895b501a04854b7b168a444ef9253af8
parent55503711adffb2040c11418cdf564cd1a1924309 (diff)
downloadlinux-c15556cb344a6e8235393013e60a7e2648ec699e.tar.gz
linux-c15556cb344a6e8235393013e60a7e2648ec699e.tar.bz2
linux-c15556cb344a6e8235393013e60a7e2648ec699e.zip
dmaengine: mediatek: mtk-hsdma: Fix a resource leak in the error handling path of the probe function
commit 33cbd54dc515cc04b5a603603414222b4bb1448d upstream. 'mtk_hsdma_hw_deinit()' should be called in the error handling path of the probe function to undo a previous 'mtk_hsdma_hw_init()' call, as already done in the remove function. Fixes: 548c4597e984 ("dmaengine: mediatek: Add MediaTek High-Speed DMA controller for MT7622 and MT7623 SoC") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Link: https://lore.kernel.org/r/20201219124718.182664-1-christophe.jaillet@wanadoo.fr Signed-off-by: Vinod Koul <vkoul@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/dma/mediatek/mtk-hsdma.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/dma/mediatek/mtk-hsdma.c b/drivers/dma/mediatek/mtk-hsdma.c
index 4c58da742143..04d89eec11e7 100644
--- a/drivers/dma/mediatek/mtk-hsdma.c
+++ b/drivers/dma/mediatek/mtk-hsdma.c
@@ -1007,6 +1007,7 @@ static int mtk_hsdma_probe(struct platform_device *pdev)
return 0;
err_free:
+ mtk_hsdma_hw_deinit(hsdma);
of_dma_controller_free(pdev->dev.of_node);
err_unregister:
dma_async_device_unregister(dd);