]> git.baikalelectronics.ru Git - kernel.git/commit
clk: uniphier: fix memory overrun bug
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Wed, 19 Oct 2016 11:49:39 +0000 (20:49 +0900)
committerStephen Boyd <sboyd@codeaurora.org>
Wed, 19 Oct 2016 20:14:18 +0000 (13:14 -0700)
commit83cd8d78abc2d3c266d11ea8d9bd95c2e910305d
tree253f26b37d4c3866f9bfe643d1e391f2fd751376
parent327927392b77340ba4d798df9e290465ed77dddb
clk: uniphier: fix memory overrun bug

The first loop of this "for" statement writes memory beyond the
allocated clk_hw_onecell_data.

It should be:
    for (clk_num--; clk_num >= 0; clk_num--)
            ...

Or more simply:
    while (--clk_num >= 0)
            ...

Fixes: 853694d944f8 ("clk: uniphier: add core support code for UniPhier clock driver")
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
drivers/clk/uniphier/clk-uniphier-core.c