]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
clk: nxp: Fix pll0 rate check condition in LPC18xx CGU driver
authorAlok Tiwari <alok.a.tiwari@oracle.com>
Sun, 6 Jul 2025 20:11:55 +0000 (13:11 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 19 Oct 2025 14:23:07 +0000 (16:23 +0200)
commit5cb1c7600e333eb91b1749e5b7332a823104ba04
tree74f5f1c3f96a63900bbfb357cec576452b90b7e6
parentfcc494ce4346d8a515f08c32c7f30f0c9e802eca
clk: nxp: Fix pll0 rate check condition in LPC18xx CGU driver

[ Upstream commit 1624dead9a4d288a594fdf19735ebfe4bb567cb8 ]

The conditional check for the PLL0 multiplier 'm' used a logical AND
instead of OR, making the range check ineffective. This patch replaces
&& with || to correctly reject invalid values of 'm' that are either
less than or equal to 0 or greater than LPC18XX_PLL0_MSEL_MAX.

This ensures proper bounds checking during clk rate setting and rounding.

Fixes: b04e0b8fd544 ("clk: add lpc18xx cgu clk driver")
Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com>
[sboyd@kernel.org: 'm' is unsigned so remove < condition]
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/clk/nxp/clk-lpc18xx-cgu.c