Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dmaengine: mediatek: mtk-hsdma: Fix a resource leak in the error handling path of the probe function

'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>

authored by

Christophe JAILLET and committed by
Vinod Koul
33cbd54d 8fb28795

+1
+1
drivers/dma/mediatek/mtk-hsdma.c
··· 1007 1007 return 0; 1008 1008 1009 1009 err_free: 1010 + mtk_hsdma_hw_deinit(hsdma); 1010 1011 of_dma_controller_free(pdev->dev.of_node); 1011 1012 err_unregister: 1012 1013 dma_async_device_unregister(dd);