linux/drivers/clk/sunxi-ng
Frank Oltmanns ea977d7425 clk: sunxi-ng: common: Don't call hw_to_ccu_common on hw without common
In order to set the rate range of a hw sunxi_ccu_probe calls
hw_to_ccu_common() assuming all entries in desc->ccu_clks are contained
in a ccu_common struct. This assumption is incorrect and, in
consequence, causes invalid pointer de-references.

Remove the faulty call. Instead, add one more loop that iterates over
the ccu_clks and sets the rate range, if required.

Fixes: b914ec33b3 ("clk: sunxi-ng: common: Support minimum and maximum rate")
Reported-by: Robert J. Pafford <pafford.9@buckeyemail.osu.edu>
Closes: https://lore.kernel.org/lkml/DM6PR01MB58047C810DDD5D0AE397CADFF7C22@DM6PR01MB5804.prod.exchangelabs.com/
Cc: stable@vger.kernel.org
Signed-off-by: Frank Oltmanns <frank@oltmanns.dev>
Tested-by: Robert J. Pafford <pafford.9@buckeyemail.osu.edu>
Link: https://lore.kernel.org/r/20240623-sunxi-ng_fix_common_probe-v1-1-7c97e32824a1@oltmanns.dev
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
2024-06-30 23:12:44 +08:00
..
Kconfig clk: sunxi-ng: d1: Allow building for R528/T113 2023-01-08 22:06:10 +01:00
Makefile clk: sunxi-ng: Add support for the sun6i RTC clocks 2022-03-23 19:58:38 +01:00
ccu-sun4i-a10.c clk: sunxi-ng: fix module autoloading 2024-04-15 23:29:50 +02:00
ccu-sun4i-a10.h
ccu-sun5i.c
ccu-sun5i.h
ccu-sun6i-a31.c clk: sunxi-ng: fix module autoloading 2024-04-15 23:29:50 +02:00
ccu-sun6i-a31.h
ccu-sun6i-rtc.c clk: sunxi-ng: fix module autoloading 2024-04-15 23:29:50 +02:00
ccu-sun6i-rtc.h clk: sunxi-ng: Add support for the sun6i RTC clocks 2022-03-23 19:58:38 +01:00
ccu-sun8i-a23-a33.h
ccu-sun8i-a23.c clk: sunxi-ng: fix module autoloading 2024-04-15 23:29:50 +02:00
ccu-sun8i-a33.c clk: sunxi-ng: fix module autoloading 2024-04-15 23:29:50 +02:00
ccu-sun8i-a83t.c clk: sunxi-ng: fix module autoloading 2024-04-15 23:29:50 +02:00
ccu-sun8i-a83t.h
ccu-sun8i-de2.c clk: sunxi-ng: fix module autoloading 2024-04-15 23:29:50 +02:00
ccu-sun8i-de2.h
ccu-sun8i-h3.c clk: sunxi-ng: fix module autoloading 2024-04-15 23:29:50 +02:00
ccu-sun8i-h3.h dt-bindings: clock: sunxi: Export CLK_DRAM for devfreq 2021-11-23 11:29:35 +01:00
ccu-sun8i-r.c clk: sunxi-ng: fix module autoloading 2024-04-15 23:29:50 +02:00
ccu-sun8i-r.h
ccu-sun8i-r40.c clk: sunxi-ng: fix module autoloading 2024-04-15 23:29:50 +02:00
ccu-sun8i-r40.h
ccu-sun8i-v3s.c clk: sunxi-ng: fix module autoloading 2024-04-15 23:29:50 +02:00
ccu-sun8i-v3s.h clk: sunxi-ng: v3s: Correct the header guard of ccu-sun8i-v3s.h 2022-11-16 19:45:53 +01:00
ccu-sun9i-a80-de.c clk: sunxi-ng: fix module autoloading 2024-04-15 23:29:50 +02:00
ccu-sun9i-a80-de.h
ccu-sun9i-a80-usb.c clk: sunxi-ng: fix module autoloading 2024-04-15 23:29:50 +02:00
ccu-sun9i-a80-usb.h
ccu-sun9i-a80.c clk: sunxi-ng: fix module autoloading 2024-04-15 23:29:50 +02:00
ccu-sun9i-a80.h
ccu-sun20i-d1-r.c clk: sunxi-ng: fix module autoloading 2024-04-15 23:29:50 +02:00
ccu-sun20i-d1-r.h clk: sunxi-ng: Add support for the D1 SoC clocks 2021-11-23 10:29:05 +01:00
ccu-sun20i-d1.c clk: sunxi-ng: fix module autoloading 2024-04-15 23:29:50 +02:00
ccu-sun20i-d1.h clk: sunxi-ng: d1: Add CAN bus gates and resets 2023-01-08 22:06:10 +01:00
ccu-sun50i-a64.c I'm actually surprised this time. There aren't any new Qualcomm SoC clk 2024-05-18 12:48:37 -07:00
ccu-sun50i-a64.h dt-bindings: clock: sunxi: Export CLK_DRAM for devfreq 2021-11-23 11:29:35 +01:00
ccu-sun50i-a100-r.c clk: sunxi-ng: fix module autoloading 2024-04-15 23:29:50 +02:00
ccu-sun50i-a100-r.h
ccu-sun50i-a100.c clk: sunxi-ng: fix module autoloading 2024-04-15 23:29:50 +02:00
ccu-sun50i-a100.h
ccu-sun50i-h6-r.c clk: sunxi-ng: fix module autoloading 2024-04-15 23:29:50 +02:00
ccu-sun50i-h6-r.h clk: sunxi-ng: h6-r: Add RTC gate clock 2022-05-06 18:02:40 +02:00
ccu-sun50i-h6.c I'm actually surprised this time. There aren't any new Qualcomm SoC clk 2024-05-18 12:48:37 -07:00
ccu-sun50i-h6.h
ccu-sun50i-h616.c clk: sunxi-ng: fix module autoloading 2024-04-15 23:29:50 +02:00
ccu-sun50i-h616.h clk: sunxi-ng: h616: Add PLL derived 32KHz clock 2022-05-06 18:03:52 +02:00
ccu-suniv-f1c100s.c clk: sunxi-ng: fix module autoloading 2024-04-15 23:29:50 +02:00
ccu-suniv-f1c100s.h clk: sunxi-ng: f1c100s: Add IR mod clock 2022-11-16 19:49:18 +01:00
ccu_common.c clk: sunxi-ng: common: Don't call hw_to_ccu_common on hw without common 2024-06-30 23:12:44 +08:00
ccu_common.h clk: sunxi-ng: common: Support minimum and maximum rate 2024-04-15 23:21:45 +02:00
ccu_div.c
ccu_div.h clk: sunxi-ng: div: Support finding closest rate 2023-08-09 23:33:59 +08:00
ccu_frac.c
ccu_frac.h
ccu_gate.c
ccu_gate.h clk: sunxi-ng: gate: Add macros for gates with fixed dividers 2021-11-23 10:29:05 +01:00
ccu_mmc_timing.c clk: sunxi-ng: Modify mismatched function name 2023-07-31 00:52:36 +02:00
ccu_mp.c clk: sunxi-ng: Avoid computing the rate twice 2023-01-08 21:55:17 +01:00
ccu_mp.h
ccu_mult.c
ccu_mult.h
ccu_mux.c clk: sunxi-ng: mux: Support finding closest rate 2023-08-09 23:33:59 +08:00
ccu_mux.h clk: sunxi-ng: mux: Support finding closest rate 2023-08-09 23:33:59 +08:00
ccu_nk.c clk: sunxi-ng: Avoid computing the rate twice 2023-01-08 21:55:17 +01:00
ccu_nk.h
ccu_nkm.c clk: sunxi-ng: nkm: Support constraints on m/n ratio and parent rate 2024-04-15 23:23:09 +02:00
ccu_nkm.h clk: sunxi-ng: nkm: Support constraints on m/n ratio and parent rate 2024-04-15 23:23:09 +02:00
ccu_nkmp.c clk: sunxi-ng: Avoid computing the rate twice 2023-01-08 21:55:17 +01:00
ccu_nkmp.h
ccu_nm.c clk: sunxi-ng: nm: Support finding closest rate 2023-08-09 23:33:58 +08:00
ccu_nm.h clk: sunxi-ng: nm: Support finding closest rate 2023-08-09 23:33:58 +08:00
ccu_phase.c
ccu_phase.h
ccu_reset.c
ccu_reset.h
ccu_sdm.c
ccu_sdm.h