Commit f92d67e2 authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Stephen Boyd
Browse files

clk: bcm: bcm53573: fix OF node leak in init



Driver code is leaking OF node reference from of_get_parent() in
bcm53573_ilp_init().  Usage of of_get_parent() is not needed in the
first place, because the parent node will not be freed while we are
processing given node (triggered by CLK_OF_DECLARE()).  Thus fix the
leak by accessing parent directly, instead of of_get_parent().

Signed-off-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20240826065801.17081-1-krzysztof.kozlowski@linaro.org


Signed-off-by: default avatarStephen Boyd <sboyd@kernel.org>
parent f7e41b65
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -112,7 +112,7 @@ static void bcm53573_ilp_init(struct device_node *np)
		goto err_free_ilp;
	}

	ilp->regmap = syscon_node_to_regmap(of_get_parent(np));
	ilp->regmap = syscon_node_to_regmap(np->parent);
	if (IS_ERR(ilp->regmap)) {
		err = PTR_ERR(ilp->regmap);
		goto err_free_ilp;