summaryrefslogtreecommitdiff
path: root/drivers/clk/ti/dpll.c
diff options
context:
space:
mode:
authorStephen Boyd <sboyd@kernel.org>2019-08-16 01:12:49 +0300
committerStephen Boyd <sboyd@kernel.org>2019-08-16 20:22:46 +0300
commite0e04fc866929f58600aad66b969d5e1572f9e54 (patch)
tree5e97d53e2905a11421cbf14b228dfd5ace064320 /drivers/clk/ti/dpll.c
parentc42144139a383011327990a8c59a45f81b3493dd (diff)
downloadlinux-e0e04fc866929f58600aad66b969d5e1572f9e54.tar.xz
clk: ti: Don't reference clk_init_data after registration
A future patch is going to change semantics of clk_register() so that clk_hw::init is guaranteed to be NULL after a clk is registered. Avoid referencing this member here so that we don't run into NULL pointer exceptions. Cc: Tero Kristo <t-kristo@ti.com> Cc: Tony Lindgren <tony@atomide.com> Reported-by: "kernelci.org bot" <bot@kernelci.org> Signed-off-by: Stephen Boyd <sboyd@kernel.org> Link: https://lkml.kernel.org/r/20190815221249.53235-1-sboyd@kernel.org
Diffstat (limited to 'drivers/clk/ti/dpll.c')
-rw-r--r--drivers/clk/ti/dpll.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/clk/ti/dpll.c b/drivers/clk/ti/dpll.c
index 659dadb23279..f3f609c465a7 100644
--- a/drivers/clk/ti/dpll.c
+++ b/drivers/clk/ti/dpll.c
@@ -165,6 +165,7 @@ static void __init _register_dpll(void *user,
struct clk_hw_omap *clk_hw = to_clk_hw_omap(hw);
struct dpll_data *dd = clk_hw->dpll_data;
struct clk *clk;
+ const struct clk_init_data *init = hw->init;
clk = of_clk_get(node, 0);
if (IS_ERR(clk)) {
@@ -196,15 +197,15 @@ static void __init _register_dpll(void *user,
if (!IS_ERR(clk)) {
of_clk_add_provider(node, of_clk_src_simple_get, clk);
- kfree(clk_hw->hw.init->parent_names);
- kfree(clk_hw->hw.init);
+ kfree(init->parent_names);
+ kfree(init);
return;
}
cleanup:
kfree(clk_hw->dpll_data);
- kfree(clk_hw->hw.init->parent_names);
- kfree(clk_hw->hw.init);
+ kfree(init->parent_names);
+ kfree(init);
kfree(clk_hw);
}