]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
clk: ti: dra7-atl: Fix leak of of_nodes
authorDavid Lechner <dlechner@baylibre.com>
Mon, 26 Aug 2024 15:35:29 +0000 (10:35 -0500)
committerStephen Boyd <sboyd@kernel.org>
Wed, 28 Aug 2024 20:17:30 +0000 (13:17 -0700)
This fix leaking the of_node references in of_dra7_atl_clk_probe().

The docs for of_parse_phandle_with_args() say that the caller must call
of_node_put() on the returned node. This adds the missing of_node_put()
to fix the leak.

Fixes: 9ac33b0ce81f ("CLK: TI: Driver for DRA7 ATL (Audio Tracking Logic)")
Signed-off-by: David Lechner <dlechner@baylibre.com>
Link: https://lore.kernel.org/r/20240826-clk-fix-leak-v1-1-f55418a13aa6@baylibre.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
drivers/clk/ti/clk-dra7-atl.c

index d964e3affd42cea42c02dadc7aa220360e3fba22..0eab7f3e2eab9edb18a5f881ce329db1abdb5be0 100644 (file)
@@ -240,6 +240,7 @@ static int of_dra7_atl_clk_probe(struct platform_device *pdev)
                }
 
                clk = of_clk_get_from_provider(&clkspec);
+               of_node_put(clkspec.np);
                if (IS_ERR(clk)) {
                        pr_err("%s: failed to get atl clock %d from provider\n",
                               __func__, i);