diff options
author | Minjie Du <duminjie@vivo.com> | 2023-07-12 18:22:46 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-09-23 10:48:05 +0200 |
commit | 8d77e235441fc136c9ef4ea885041a17a3bf7f46 (patch) | |
tree | 3abb0ccf4ce897140b49d8f58837fdab8c8ffb5a | |
parent | ade463bc7df5a280fb5a58f825d7cee26d5e2aba (diff) | |
download | linux-stable-8d77e235441fc136c9ef4ea885041a17a3bf7f46.tar.gz linux-stable-8d77e235441fc136c9ef4ea885041a17a3bf7f46.tar.bz2 linux-stable-8d77e235441fc136c9ef4ea885041a17a3bf7f46.zip |
drivers: clk: keystone: Fix parameter judgment in _of_pll_clk_init()
[ Upstream commit a995c50db887ef97f3160775aef7d772635a6f6e ]
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: b9e0d40c0d83 ("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>
-rw-r--r-- | drivers/clk/keystone/pll.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/clk/keystone/pll.c b/drivers/clk/keystone/pll.c index e7e840fb74ea..526694c2a6c9 100644 --- a/drivers/clk/keystone/pll.c +++ b/drivers/clk/keystone/pll.c @@ -213,7 +213,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; } |