Skip to content

Commit

Permalink
drivers: clk: keystone: Fix parameter judgment in _of_pll_clk_init()
Browse files Browse the repository at this point in the history
[ Upstream commit a995c50 ]

The function clk_register_pll() may return NULL or an ERR_PTR. Don't
treat an ERR_PTR as valid.

Signed-off-by: Minjie Du <duminjie@vivo.com>
Link: https://lore.kernel.org/r/20230712102246.10348-1-duminjie@vivo.com
Fixes: b9e0d40 ("clk: keystone: add Keystone PLL clock driver")
[sboyd@kernel.org: Reword commit text]
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Minjie Du authored and gregkh committed Sep 13, 2023
1 parent d96da88 commit 4a43285
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/clk/keystone/pll.c
Expand Up @@ -209,7 +209,7 @@ static void __init _of_pll_clk_init(struct device_node *node, bool pllctrl)
}

clk = clk_register_pll(NULL, node->name, parent_name, pll_data);
if (clk) {
if (!IS_ERR_OR_NULL(clk)) {
of_clk_add_provider(node, of_clk_src_simple_get, clk);
return;
}
Expand Down

0 comments on commit 4a43285

Please sign in to comment.