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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Dec 2018 13:15:19 +0000 (14:15 +0100)
commit8e09f402321ebf81ac5ae1dd0b55e2265339706e
treee389c274590350463c4b1cf4a339c99a8c4bd647
parent70c8839464419610b969dbeb90d4f0bf854ec9a3
clk: mmp: Off by one in mmp_clk_add()

[ Upstream commit 2e85c57493e391b93445c1e0d530b36b95becc64 ]

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: 4661fda10f8b ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/clk/mmp/clk.c