[PATCH] clk: vt8500: Return the error from vtwm_pll_determine_rate()
From: Weidong Wang via B4 Relay
Date: Thu Dec 03 2026 - 19:59:28 EST
From: Weidong Wang <weidongw@xxxxxxxxxxxx>
When a *_find_pll_bits() helper rejects the requested rate,
vtwm_pll_determine_rate() stores the negative errno in the unsigned
req->rate and returns 0. The clock core then treats the request as
successful and clk_round_rate() reports a bogus rate near ULONG_MAX
instead of an error.
Return the error as the old round_rate() op did, and only set req->rate
on success.
Found by a static analysis tool.
Fixes: ff03cca71ebd ("clk: vt8500: convert from round_rate() to determine_rate()")
Signed-off-by: Weidong Wang <weidongw@xxxxxxxxxxxx>
---
The fix and the changelog were drafted with AI assistance (Claude Code,
with a second review by OpenAI Codex), then reviewed by the submitter.
Testing:
- Compile-tested on x86_64 (allmodconfig, W=1):
drivers/clk/clk-vt8500.o; no new warnings.
- checkpatch.pl --strict: no errors or warnings.
---
drivers/clk/clk-vt8500.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/clk/clk-vt8500.c b/drivers/clk/clk-vt8500.c
index 581ac00c31bc..4624b902f82c 100644
--- a/drivers/clk/clk-vt8500.c
+++ b/drivers/clk/clk-vt8500.c
@@ -637,9 +637,9 @@ static int vtwm_pll_determine_rate(struct clk_hw *hw,
}
if (ret)
- req->rate = ret;
- else
- req->rate = round_rate;
+ return ret;
+
+ req->rate = round_rate;
return 0;
}
---
base-commit: 65cf6d500df204cd5bb487773b26c9221d73a247
change-id: 20261203-kbug-l1923-9d57c5388231
Best regards,
--
Weidong Wang <weidongw@xxxxxxxxxxxx>