]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
clk: scpi: Unregister child clock providers on remove
authorStepan Ionichev <sozdayvek@gmail.com>
Wed, 13 May 2026 09:09:00 +0000 (14:09 +0500)
committerSudeep Holla <sudeep.holla@kernel.org>
Thu, 14 May 2026 11:15:38 +0000 (12:15 +0100)
SCPI clock providers are registered for each child node in
scpi_clk_add(), but scpi_clocks_remove() unregisters the parent node on
each iteration.

of_clk_del_provider() matches providers by the node used at registration
time, so passing the parent node leaves the child providers registered.
This leaks the provider allocations and the node references held by the
clock provider core.

Pass the child node to of_clk_del_provider() so the remove path matches
the probe path.

Fixes: cd52c2a4b5c4 ("clk: add support for clocks provided by SCP(System Control Processor)")
Signed-off-by: Stepan Ionichev <sozdayvek@gmail.com>
Link: https://patch.msgid.link/20260513090900.5323-1-sozdayvek@gmail.com
(sudeep.holla: Updated commit title and message a bit)
Signed-off-by: Sudeep Holla <sudeep.holla@kernel.org>
drivers/clk/clk-scpi.c

index 7806569cd0d5c4e32700edb10e4edf2185610a81..24cee7c9fda6c51bc1614fa8e8acaa944ffb01e0 100644 (file)
@@ -258,7 +258,7 @@ static void scpi_clocks_remove(struct platform_device *pdev)
        }
 
        for_each_available_child_of_node(np, child)
-               of_clk_del_provider(np);
+               of_clk_del_provider(child);
 }
 
 static int scpi_clocks_probe(struct platform_device *pdev)