]> git.baikalelectronics.ru Git - kernel.git/commit
clk: mmp: Off by one in mmp_clk_add()
authorDan Carpenter <dan.carpenter@oracle.com>
Mon, 3 Dec 2018 14:51:43 +0000 (17:51 +0300)
committerStephen Boyd <sboyd@kernel.org>
Mon, 3 Dec 2018 17:54:48 +0000 (09:54 -0800)
commit4e21425c47dde737874c5db369e6c2a6b5b31401
tree86b02df835a2f43eab2a64bd94117651d789eba4
parentaf312ee816dbd57ed1850032f39a3b4483c610df
clk: mmp: Off by one in mmp_clk_add()

The > comparison should be >= or we write one element beyond the end of
the unit->clk_table[] array.

(The unit->clk_table[] array is allocated in the mmp_clk_init() function
and it has unit->nr_clks elements).

Fixes: a061bd99d88a ("clk: mmp: add basic support functions for DT support")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
drivers/clk/mmp/clk.c