linux-stable/drivers/clk/mvebu
Dan Carpenter 38391d6b11 clk: mvebu: Off by one bugs in cp110_of_clk_get()
[ Upstream commit d9f5b7f5dd ]

These > comparisons should be >= to prevent reading beyond the end of
of the clk_data->hws[] buffer.

The clk_data->hws[] array is allocated in cp110_syscon_common_probe()
when we do:
	cp110_clk_data = devm_kzalloc(dev, sizeof(*cp110_clk_data) +
				      sizeof(struct clk_hw *) * CP110_CLK_NUM,
				      GFP_KERNEL);
As you can see, it has CP110_CLK_NUM elements which is equivalent to
CP110_MAX_CORE_CLOCKS + CP110_MAX_GATABLE_CLOCKS.

Fixes: d3da3eaef7 ("clk: mvebu: new driver for Armada CP110 system controller")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2018-12-21 14:11:37 +01:00
..
ap806-system-controller.c clk: mvebu: adjust AP806 CPU clock frequencies to production chip 2017-11-15 15:53:16 +01:00
armada-37xx-periph.c clk: mvebu: armada-37xx-periph: Fix the clock gate flag 2016-10-17 15:35:10 -07:00
armada-37xx-tbg.c clk: mvebu Add the time base generator clocks for Armada 3700 2016-08-15 14:10:20 -07:00
armada-37xx-xtal.c clk: mvebu: Add the xtal clock for Armada 3700 SoC 2016-08-15 14:07:04 -07:00
armada-38x.c clk: mvebu: armada-38x: add support for missing clocks 2018-04-24 09:34:14 +02:00
armada-39x.c clk: mvebu: armada-39x: add clk description for supported interfaces 2016-08-12 18:20:01 -07:00
armada-370.c clk: mvebu: flag the crypto clk as CLK_IGNORE_UNUSED 2015-06-18 13:51:45 -07:00
armada-375.c clk: mvebu: armada-375: Fix the description of the SAR in the comment 2014-09-09 15:15:22 +00:00
armada-xp.c clk: mvebu: armada-xp: maintain clock init order 2014-02-06 18:06:50 +00:00
clk-corediv.c clk: mvebu: Support Armada 380 SoC on the core divider clock 2014-03-13 23:24:23 +00:00
clk-cpu.c clk: mvebu: Use of_clk_get_parent_name() 2015-10-16 16:35:43 -07:00
common.c clk: mvebu: Remove CLK_IS_ROOT 2016-03-03 11:26:42 -08:00
common.h clk: mvebu: extend common code to allow an optional refclk 2015-03-04 15:18:48 +01:00
cp110-system-controller.c clk: mvebu: Off by one bugs in cp110_of_clk_get() 2018-12-21 14:11:37 +01:00
dove-divider.c clk: mvebu: Remove CLK_IS_ROOT 2016-03-03 11:26:42 -08:00
dove-divider.h clk: add Dove PLL divider support for GPU, VMeta and AXI clocks 2015-12-22 12:25:00 -08:00
dove.c clk: add Dove PLL divider support for GPU, VMeta and AXI clocks 2015-12-22 12:25:00 -08:00
Kconfig clk: mvebu: Add the xtal clock for Armada 3700 SoC 2016-08-15 14:07:04 -07:00
kirkwood.c clk: move the common clock's to_clk_*(_hw) macros to clk-provider.h 2016-01-29 12:59:50 -08:00
Makefile clk: mvebu: Add the peripheral clock driver for Armada 3700 2016-08-15 14:10:27 -07:00
orion.c clk: mvebu: Add clk support for the orion5x SoC mv88f5181 2016-09-21 11:49:09 +02:00