linux-stable/drivers/clk/sophgo
Zichen Xie 00f8f70a0e clk: sophgo: avoid integer overflow in sg2042_pll_recalc_rate()
This was found by a static analyzer.
There may be a potential integer overflow issue in
sg2042_pll_recalc_rate(). numerator is defined as u64 while
parent_rate is defined as unsigned long and ctrl_table.fbdiv
is defined as unsigned int. On 32-bit machine, the result of
the calculation will be limited to "u32" without correct casting.
Integer overflow may occur on high-performance systems.

Fixes: 48cf7e0138 ("clk: sophgo: Add SG2042 clock driver")
Signed-off-by: Zichen Xie <zichenxie0106@gmail.com>
Reviewed-by: Chen Wang <unicorn_wang@outlook.com>
Link: https://lore.kernel.org/r/20241023145146.13130-1-zichenxie0106@gmail.com
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
2024-10-28 16:47:22 -07:00
..
clk-cv18xx-common.c clk: sophgo: Add clock support for CV1800 SoC 2024-04-11 00:02:20 -07:00
clk-cv18xx-common.h clk: sophgo: Add clock support for CV1800 SoC 2024-04-11 00:02:20 -07:00
clk-cv18xx-ip.c clk/sophgo: Using BUG() instead of unreachable() in mmux_get_parent_id() 2024-07-10 14:15:54 -07:00
clk-cv18xx-ip.h clk: sophgo: Add clock support for CV1800 SoC 2024-04-11 00:02:20 -07:00
clk-cv18xx-pll.c clk: sophgo: avoid open-coded 64-bit division 2024-04-19 14:38:01 -07:00
clk-cv18xx-pll.h clk: sophgo: Add clock support for CV1800 SoC 2024-04-11 00:02:20 -07:00
clk-cv1800.c clk: sophgo: add missing MODULE_DESCRIPTION() macro 2024-06-03 15:42:54 -07:00
clk-cv1800.h clk: sophgo: Add clock support for CV1810 SoC 2024-04-11 00:02:20 -07:00
clk-sg2042-clkgen.c clk: sophgo: Add SG2042 clock driver 2024-06-14 14:49:40 +08:00
clk-sg2042-pll.c clk: sophgo: avoid integer overflow in sg2042_pll_recalc_rate() 2024-10-28 16:47:22 -07:00
clk-sg2042-rpgate.c clk: sophgo: Add SG2042 clock driver 2024-06-14 14:49:40 +08:00
clk-sg2042.h clk: sophgo: Add SG2042 clock driver 2024-06-14 14:49:40 +08:00
Kconfig clk: sophgo: Add SG2042 clock driver 2024-06-14 14:49:40 +08:00
Makefile clk: sophgo: Add SG2042 clock driver 2024-06-14 14:49:40 +08:00