[PATCH 04/12] clk: samsung: artpec9: Terminate PLL rate tables with sentinels

From: Lee Jones

Date: Fri Nov 27 2026 - 13:05:11 EST


_samsung_clk_register_pll() sizes each PLL rate table by scanning until
it encounters an entry with .rate == 0, then copies the counted entries
into pll->rate_table. However, artpec9_pll_audio_rates,
artpec9_pll_cpucl_rates, and artpec9_pll_fsys1_rates all omit a
terminating zero sentinel, causing out-of-bounds reads into adjacent
read-only data and populating pll->rate_table with bogus entries.

Append a sentinel entry to each of the 3 PLL rate tables.

Fixes: 85cc5be65b82 ("clk: samsung: artpec-9: Add initial clock support for ARTPEC-9 SoC")
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Lee Jones <lee@xxxxxxxxxx>
---
drivers/clk/samsung/clk-artpec9.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/clk/samsung/clk-artpec9.c b/drivers/clk/samsung/clk-artpec9.c
index 2eaf8117638c..aee5a9283de4 100644
--- a/drivers/clk/samsung/clk-artpec9.c
+++ b/drivers/clk/samsung/clk-artpec9.c
@@ -176,6 +176,7 @@ static const unsigned long cmu_cmu_clk_regs[] __initconst = {

static const struct samsung_pll_rate_table artpec9_pll_audio_rates[] __initconst = {
PLL_A9FRACO_RATE(25 * MHZ, 589824000U, 94, 1, 3, 6238440),
+ { /* sentinel */ }
};

static const struct samsung_pll_clock cmu_cmu_pll_clks[] __initconst = {
@@ -490,6 +491,7 @@ static const struct samsung_pll_rate_table artpec9_pll_cpucl_rates[] __initconst
PLL_35XX_RATE(25 * MHZ, 1400000000U, 56, 1, 0),
PLL_35XX_RATE(25 * MHZ, 1100000000U, 44, 1, 0),
PLL_35XX_RATE(25 * MHZ, 850000000U, 34, 1, 0),
+ { /* sentinel */ }
};

static const struct samsung_pll_clock cmu_cpucl_pll_clks[] __initconst = {
@@ -815,6 +817,7 @@ static const unsigned long cmu_fsys1_clk_regs[] __initconst = {

static const struct samsung_pll_rate_table artpec9_pll_fsys1_rates[] __initconst = {
PLL_35XX_RATE(25 * MHZ, 2000000000U, 80, 1, 0),
+ { /* sentinel */ }
};

static const struct samsung_pll_clock cmu_fsys1_pll_clks[] __initconst = {
--
2.56.1.839.g22a8290db9-goog