Re: [PATCH] clk: mvebu: Off by one bugs in cp110_of_clk_get()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Quoting Dan Carpenter (2018-12-03 06:50:55)
> 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: d3da3eaef7f4 ("clk: mvebu: new driver for Armada CP110 system controller")
> Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
> ---

Applied to clk-fixes





[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux