[PATCH 3/3] dmaengine: stm32-mdma: Use managed OF DMA controller registration
Tian Xuechen
202300460064 at mail.sdu.edu.cn
Fri Nov 27 03:33:32 PST 2026
From: Tian Xuechen <202300460064 at mail.sdu.edu.cn>
The OF controller outlives the managed DMA engine and its channel
data on removal. Use the managed registration helper to withdraw the
OF controller first.
This issue was found by our static analysis tool under development.
Fixes: a4ffb13c8946 ("dmaengine: Add STM32 MDMA driver")
Signed-off-by: Tian Xuechen <202300460064 at mail.sdu.edu.cn>
---
drivers/dma/stm32/stm32-mdma.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/dma/stm32/stm32-mdma.c b/drivers/dma/stm32/stm32-mdma.c
index 4851c1c7ce0c..c95a9bb1171b 100644
--- a/drivers/dma/stm32/stm32-mdma.c
+++ b/drivers/dma/stm32/stm32-mdma.c
@@ -1714,7 +1714,8 @@ static int stm32_mdma_probe(struct platform_device *pdev)
if (ret)
goto err_clk;
- ret = of_dma_controller_register(of_node, stm32_mdma_of_xlate, dmadev);
+ ret = devm_of_dma_controller_register(&pdev->dev, of_node,
+ stm32_mdma_of_xlate, dmadev);
if (ret < 0) {
dev_err(&pdev->dev,
"STM32 MDMA DMA OF registration failed %d\n", ret);
--
2.43.0
More information about the linux-arm-kernel
mailing list