• Dan Carpenter's avatar
    clk: mvebu: Off by one bugs in cp110_of_clk_get() · d9f5b7f5
    Dan Carpenter authored
    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: d3da3eae ("clk: mvebu: new driver for Armada CP110 system controller")
    Signed-off-by: 's avatarDan Carpenter <dan.carpenter@oracle.com>
    Signed-off-by: 's avatarStephen Boyd <sboyd@kernel.org>
    d9f5b7f5
Name
Last commit
Last update
..
Kconfig Loading commit data...
Makefile Loading commit data...
ap806-system-controller.c Loading commit data...
armada-370.c Loading commit data...
armada-375.c Loading commit data...
armada-37xx-periph.c Loading commit data...
armada-37xx-tbg.c Loading commit data...
armada-37xx-xtal.c Loading commit data...
armada-38x.c Loading commit data...
armada-39x.c Loading commit data...
armada-xp.c Loading commit data...
clk-corediv.c Loading commit data...
clk-cpu.c Loading commit data...
common.c Loading commit data...
common.h Loading commit data...
cp110-system-controller.c Loading commit data...
dove-divider.c Loading commit data...
dove-divider.h Loading commit data...
dove.c Loading commit data...
kirkwood.c Loading commit data...
mv98dx3236.c Loading commit data...
orion.c Loading commit data...