[PATCH] clk: starfive: jh7110: reject oscillator lookup errors

Slavin Liu posted 1 patch 1 week, 4 days ago
drivers/clk/starfive/clk-starfive-jh7110-sys.c | 3 +++
1 file changed, 3 insertions(+)
[PATCH] clk: starfive: jh7110: reject oscillator lookup errors
Posted by Slavin Liu 1 week, 4 days ago
Clock lookup may fail while allocating a consumer reference. Return
a notifier error rather than passing ERR_PTR as the new clock parent.

Detected by static analysis and reviewed with AI-assisted source auditing.

Fixes: 538d5477b252 ("clk: starfive: jh7110-sys: Add notifier for PLL0 clock")
Assisted-by: LLM
Signed-off-by: Slavin Liu <bolin.liu@seu.edu.cn>
---
 drivers/clk/starfive/clk-starfive-jh7110-sys.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/clk/starfive/clk-starfive-jh7110-sys.c b/drivers/clk/starfive/clk-starfive-jh7110-sys.c
index 03c17cd2032f..847c0a39e5ab 100644
--- a/drivers/clk/starfive/clk-starfive-jh7110-sys.c
+++ b/drivers/clk/starfive/clk-starfive-jh7110-sys.c
@@ -390,6 +390,9 @@ static int jh7110_pll0_clk_notifier_cb(struct notifier_block *nb,
 	if (action == PRE_RATE_CHANGE) {
 		struct clk *osc = clk_get(priv->dev, "osc");
 
+		if (IS_ERR(osc))
+			return notifier_from_errno(PTR_ERR(osc));
+
 		priv->original_clk = clk_get_parent(cpu_root);
 		ret = clk_set_parent(cpu_root, osc);
 		clk_put(osc);
Re: [PATCH] clk: starfive: jh7110: reject oscillator lookup errors
Posted by Brian Masney 6 days, 12 hours ago
On Sun, 13 Sep 2026 20:51:12 +0800, Slavin Liu wrote:
> clk: starfive: jh7110: reject oscillator lookup errors

Applied, thanks!

[1/1] clk: starfive: jh7110: reject oscillator lookup errors
      commit: 54d0b6903921d121fa750546f2b38cc3f5c7e64f

Best regards,
-- 
Brian Masney <bmasney@redhat.com>