public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] dmaengine: mediatek: mtk-hsdma: Fix a resource leak in the error handling path of the probe function
@ 2020-12-19 12:47 Christophe JAILLET
  2020-12-21 14:22 ` Vinod Koul
  0 siblings, 1 reply; 2+ messages in thread
From: Christophe JAILLET @ 2020-12-19 12:47 UTC (permalink / raw)
  To: sean.wang, vkoul, dan.j.williams, matthias.bgg
  Cc: kernel-janitors, linux-kernel, Christophe JAILLET, dmaengine,
	linux-mediatek, linux-arm-kernel

'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>
---
'mtk_hsdma_hw_init()' can return an error code, it could be good to check
it as well.
---
 drivers/dma/mediatek/mtk-hsdma.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/dma/mediatek/mtk-hsdma.c b/drivers/dma/mediatek/mtk-hsdma.c
index f133ae8dece1..6ad8afbb95f2 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);
-- 
2.27.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] dmaengine: mediatek: mtk-hsdma: Fix a resource leak in the error handling path of the probe function
  2020-12-19 12:47 [PATCH] dmaengine: mediatek: mtk-hsdma: Fix a resource leak in the error handling path of the probe function Christophe JAILLET
@ 2020-12-21 14:22 ` Vinod Koul
  0 siblings, 0 replies; 2+ messages in thread
From: Vinod Koul @ 2020-12-21 14:22 UTC (permalink / raw)
  To: Christophe JAILLET
  Cc: sean.wang, kernel-janitors, linux-kernel, dmaengine,
	linux-mediatek, matthias.bgg, dan.j.williams, linux-arm-kernel

On 19-12-20, 13:47, Christophe JAILLET wrote:
> '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.

Applied, thanks

-- 
~Vinod

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-12-21 14:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-19 12:47 [PATCH] dmaengine: mediatek: mtk-hsdma: Fix a resource leak in the error handling path of the probe function Christophe JAILLET
2020-12-21 14:22 ` Vinod Koul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox