Skip to content

Commit 3de1320

Browse files
committed
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
2 parents c369299 + 2f7ae8a commit 3de1320

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

drivers/clk/microchip/clk-mpfs-ccc.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ static int mpfs_ccc_register_outputs(struct device *dev, struct mpfs_ccc_out_hw_
178178
return dev_err_probe(dev, ret, "failed to register clock id: %d\n",
179179
out_hw->id);
180180

181-
data->hw_data.hws[out_hw->id] = &out_hw->divider.hw;
181+
data->hw_data.hws[out_hw->id - 2] = &out_hw->divider.hw;
182182
}
183183

184184
return 0;
@@ -234,6 +234,10 @@ static int mpfs_ccc_probe(struct platform_device *pdev)
234234
unsigned int num_clks;
235235
int ret;
236236

237+
/*
238+
* If DLLs get added here, mpfs_ccc_register_outputs() currently packs
239+
* sparse clock IDs in the hws array
240+
*/
237241
num_clks = ARRAY_SIZE(mpfs_ccc_pll_clks) + ARRAY_SIZE(mpfs_ccc_pll0out_clks) +
238242
ARRAY_SIZE(mpfs_ccc_pll1out_clks);
239243

0 commit comments

Comments
 (0)