summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Boyd <sboyd@kernel.org>2026-04-12 02:18:18 +0300
committerStephen Boyd <sboyd@kernel.org>2026-04-12 02:20:57 +0300
commit3de1320ae99adf0c6d606b5a8f0ea4d65d5152bd (patch)
tree2d939a4685f39d69cf79b2dbabdd301f1197f474
parentc369299895a591d96745d6492d4888259b004a9e (diff)
parent2f7ae8ab6aa73daaf080d5332110357c29df9c36 (diff)
downloadlinux-3de1320ae99adf0c6d606b5a8f0ea4d65d5152bd.tar.xz
Merge tag 'clk-microchip-fixes-7.0' of https://git.kernel.org/pub/scm/linux/kernel/git/at91/linux into clk-fixes
Pull a microchip clk driver fix from Claudiu Beznea: - Fix out of bounds access for MPFS CCC clock controller * tag 'clk-microchip-fixes-7.0' of https://git.kernel.org/pub/scm/linux/kernel/git/at91/linux: clk: microchip: mpfs-ccc: fix out of bounds access during output registration
-rw-r--r--drivers/clk/microchip/clk-mpfs-ccc.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/clk/microchip/clk-mpfs-ccc.c b/drivers/clk/microchip/clk-mpfs-ccc.c
index 3a3ea2d142f8..0a76a1aaa50f 100644
--- a/drivers/clk/microchip/clk-mpfs-ccc.c
+++ b/drivers/clk/microchip/clk-mpfs-ccc.c
@@ -178,7 +178,7 @@ static int mpfs_ccc_register_outputs(struct device *dev, struct mpfs_ccc_out_hw_
return dev_err_probe(dev, ret, "failed to register clock id: %d\n",
out_hw->id);
- data->hw_data.hws[out_hw->id] = &out_hw->divider.hw;
+ data->hw_data.hws[out_hw->id - 2] = &out_hw->divider.hw;
}
return 0;
@@ -234,6 +234,10 @@ static int mpfs_ccc_probe(struct platform_device *pdev)
unsigned int num_clks;
int ret;
+ /*
+ * If DLLs get added here, mpfs_ccc_register_outputs() currently packs
+ * sparse clock IDs in the hws array
+ */
num_clks = ARRAY_SIZE(mpfs_ccc_pll_clks) + ARRAY_SIZE(mpfs_ccc_pll0out_clks) +
ARRAY_SIZE(mpfs_ccc_pll1out_clks);