]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - ti-linux-kernel/ti-linux-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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Dec 2018 13:11:37 +0000 (14:11 +0100)
commit4ff9a2f211eade1f706a522285646ec5cfdd217e
tree057e209a3978a6bc4fb6580e0359a80c48ba5009
parent38391d6b11449ee86e3f6af003e4218ab95d3bec
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