VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   33 Branches   55 Tags
author: Christophe JAILLET <christophe.jaillet@wanadoo.fr> 2020-12-19 14:28:00 +0100 committer: Vinod Koul <vkoul@kernel.org> 2020-12-29 10:08:00 +0530 commit: d645148cc82ca7fbacaa601414a552184e9c6dd3 parent: 33cbd54dc515cc04b5a603603414222b4bb1448d
Commit Summary:
dmaengine: milbeaut-xdmac: Fix a resource leak in the error handling path of the probe function
Diffstat:
1 file changed, 3 insertions, 1 deletion
diff --git a/drivers/dma/milbeaut-xdmac.c b/drivers/dma/milbeaut-xdmac.c
index 584c931e807a..d29d01e730aa 100644
--- a/drivers/dma/milbeaut-xdmac.c
+++ b/drivers/dma/milbeaut-xdmac.c
@@ -350,7 +350,7 @@ static int milbeaut_xdmac_probe(struct platform_device *pdev)
 
 	ret = dma_async_device_register(ddev);
 	if (ret)
-		return ret;
+		goto disable_xdmac;
 
 	ret = of_dma_controller_register(dev->of_node,
 					 of_dma_simple_xlate, mdev);
@@ -363,6 +363,8 @@ static int milbeaut_xdmac_probe(struct platform_device *pdev)
 
 unregister_dmac:
 	dma_async_device_unregister(ddev);
+disable_xdmac:
+	disable_xdmac(mdev);
 	return ret;
 }