[PATCH 1/3] dmaengine: stm32-dmamux: Unregister the DMA router on removal
Frank Li
Frank.li at oss.nxp.com
Fri Nov 27 07:15:39 PST 2026
On Fri, Nov 27, 2026 at 07:33:30PM +0800, Tian Xuechen wrote:
> From: Tian Xuechen <202300460064 at mail.sdu.edu.cn>
>
> The DMA router remains in the OF registry after its device-managed
> data is released. Remove the routing entry when the device is
> unbound.
>
> This issue was found by our static analysis tool under development.
>
> Fixes: df7e762db5f6 ("dmaengine: Add STM32 DMAMUX driver")
> Signed-off-by: Tian Xuechen <202300460064 at mail.sdu.edu.cn>
> ---
> drivers/dma/stm32/stm32-dmamux.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/drivers/dma/stm32/stm32-dmamux.c b/drivers/dma/stm32/stm32-dmamux.c
> index 57318715d9f3..6f49d78bfe3d 100644
> --- a/drivers/dma/stm32/stm32-dmamux.c
> +++ b/drivers/dma/stm32/stm32-dmamux.c
> @@ -389,8 +389,14 @@ static const struct of_device_id stm32_dmamux_match[] = {
> {},
> };
>
> +static void stm32_dmamux_remove(struct platform_device *pdev)
> +{
> + of_dma_router_free(pdev->dev.of_node);
> +}
> +
Add dev manage API for router_register()
Frank
> static struct platform_driver stm32_dmamux_driver = {
> .probe = stm32_dmamux_probe,
> + .remove = stm32_dmamux_remove,
> .driver = {
> .name = "stm32-dmamux",
> .of_match_table = stm32_dmamux_match,
>
> --
> 2.43.0
>
More information about the linux-arm-kernel
mailing list