From: Minjie Du <duminjie@vivo.com>
To: Santosh Shilimkar <ssantosh@kernel.org>,
Michael Turquette <mturquette@baylibre.com>,
Stephen Boyd <sboyd@kernel.org>,
linux-kernel@vger.kernel.org (open list:ARM/TEXAS INSTRUMENT
KEYSTONE CLOCK FRAMEWORK),
linux-clk@vger.kernel.org (open list:COMMON CLK FRAMEWORK)
Cc: opensource.kernel@vivo.com, Minjie Du <duminjie@vivo.com>
Subject: [PATCH v1] drivers: clk: keystone: Fix parameter judgment in _of_pll_clk_init()
Date: Wed, 12 Jul 2023 18:22:46 +0800 [thread overview]
Message-ID: <20230712102246.10348-1-duminjie@vivo.com> (raw)
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
next reply other threads:[~2023-07-12 10:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-12 10:22 Minjie Du [this message]
2023-07-19 21:40 ` Stephen Boyd
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230712102246.10348-1-duminjie@vivo.com \
--to=duminjie@vivo.com \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=opensource.kernel@vivo.com \
--cc=sboyd@kernel.org \
--cc=ssantosh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®