]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob
7a7212eaad56fb36db72cfd12a1ba3d28041b6fe
[thirdparty/kernel/stable-queue.git] /
1 From 33cbd54dc515cc04b5a603603414222b4bb1448d Mon Sep 17 00:00:00 2001
2 From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
3 Date: Sat, 19 Dec 2020 13:47:18 +0100
4 Subject: dmaengine: mediatek: mtk-hsdma: Fix a resource leak in the error handling path of the probe function
5
6 From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
7
8 commit 33cbd54dc515cc04b5a603603414222b4bb1448d upstream.
9
10 'mtk_hsdma_hw_deinit()' should be called in the error handling path of the
11 probe function to undo a previous 'mtk_hsdma_hw_init()' call, as already
12 done in the remove function.
13
14 Fixes: 548c4597e984 ("dmaengine: mediatek: Add MediaTek High-Speed DMA controller for MT7622 and MT7623 SoC")
15 Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
16 Link: https://lore.kernel.org/r/20201219124718.182664-1-christophe.jaillet@wanadoo.fr
17 Signed-off-by: Vinod Koul <vkoul@kernel.org>
18 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
19
20 ---
21 drivers/dma/mediatek/mtk-hsdma.c | 1 +
22 1 file changed, 1 insertion(+)
23
24 --- a/drivers/dma/mediatek/mtk-hsdma.c
25 +++ b/drivers/dma/mediatek/mtk-hsdma.c
26 @@ -1007,6 +1007,7 @@ static int mtk_hsdma_probe(struct platfo
27 return 0;
28
29 err_free:
30 + mtk_hsdma_hw_deinit(hsdma);
31 of_dma_controller_free(pdev->dev.of_node);
32 err_unregister:
33 dma_async_device_unregister(dd);