drivers: clk: keystone: Fix parameter judgment in _of_pll_clk_init()
Subsystems (2)
PATCH 1/1 drivers: clk: keystone: Fix parameter judgment in _of_pll_clk_init()
The function clk_register_pll() may return NULL(in line 149) or ERR_PTR (in line 131).
Fix: make IS_ERR_OR_NULL() judge the clk_register_pll() function return.
Signed-off-by Minjie Du <[email protected]>
--- drivers/clk/keystone/pll.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/keystone/pll.c +1 -1
@@ -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 ; }
Signature · 1 line
2.39.0
Quoting Minjie Du (2023-07-12 03:22:46)
Quoted 6 lines
The function
clk_register_pll()may return NULL(in line 149) orERR_PTR(in line 131).
Fix: makeIS_ERR_OR_NULL()judge theclk_register_pll()function return.Signed-off-by Minjie Du <[email protected]>---
Applied to clk-next