public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] drivers: clk: keystone: Fix parameter judgment in _of_pll_clk_init()
@ 2023-07-12 10:22 Minjie Du
  2023-07-19 21:40 ` Stephen Boyd
  0 siblings, 1 reply; 2+ messages in thread
From: Minjie Du @ 2023-07-12 10:22 UTC (permalink / raw)
  To: Santosh Shilimkar, Michael Turquette, Stephen Boyd,
	open list:ARM/TEXAS INSTRUMENT KEYSTONE CLOCK FRAMEWORK,
	open list:COMMON CLK FRAMEWORK
  Cc: opensource.kernel, Minjie Du

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 <duminjie@vivo.com>
---
 drivers/clk/keystone/pll.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/keystone/pll.c b/drivers/clk/keystone/pll.c
index d59a7621b..ee5c72369 100644
--- a/drivers/clk/keystone/pll.c
+++ b/drivers/clk/keystone/pll.c
@@ -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;
 	}
-- 
2.39.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v1] drivers: clk: keystone: Fix parameter judgment in _of_pll_clk_init()
  2023-07-12 10:22 [PATCH v1] drivers: clk: keystone: Fix parameter judgment in _of_pll_clk_init() Minjie Du
@ 2023-07-19 21:40 ` Stephen Boyd
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Boyd @ 2023-07-19 21:40 UTC (permalink / raw)
  To: Michael Turquette, Minjie Du, Santosh Shilimkar, linux-clk,
	linux-kernel
  Cc: opensource.kernel, Minjie Du

Quoting Minjie Du (2023-07-12 03:22:46)
> 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 <duminjie@vivo.com>
> ---

Applied to clk-next

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-07-19 21:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-12 10:22 [PATCH v1] drivers: clk: keystone: Fix parameter judgment in _of_pll_clk_init() Minjie Du
2023-07-19 21:40 ` Stephen Boyd

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox