author | Dan Carpenter <dan.carpenter@oracle.com> | |
Mon, 3 Dec 2018 14:51:43 +0000 (17:51 +0300) | ||
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
Fri, 21 Dec 2018 13:11:37 +0000 (14:11 +0100) | ||
commit | 4ff9a2f211eade1f706a522285646ec5cfdd217e | |
tree | 057e209a3978a6bc4fb6580e0359a80c48ba5009 | tree | snapshot (tar.xz tar.gz zip) |
parent | 38391d6b11449ee86e3f6af003e4218ab95d3bec | commit | diff |
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>
[ 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 | diff | blob | history |