提交 3294bee8 编写于 作者: D Dan Carpenter 提交者: Stephen Boyd

clk: versatile: off by one in clk_sp810_timerclken_of_get()

The ">" should be ">=" or we end up reading beyond the end of the array.

Fixes: 6e973d2c ('clk: vexpress: Add separate SP810 driver')
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Acked-by: NPawel Moll <pawel.moll@arm.com>
Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
上级 e323d56e
...@@ -129,8 +129,8 @@ static struct clk *clk_sp810_timerclken_of_get(struct of_phandle_args *clkspec, ...@@ -129,8 +129,8 @@ static struct clk *clk_sp810_timerclken_of_get(struct of_phandle_args *clkspec,
{ {
struct clk_sp810 *sp810 = data; struct clk_sp810 *sp810 = data;
if (WARN_ON(clkspec->args_count != 1 || clkspec->args[0] > if (WARN_ON(clkspec->args_count != 1 ||
ARRAY_SIZE(sp810->timerclken))) clkspec->args[0] >= ARRAY_SIZE(sp810->timerclken)))
return NULL; return NULL;
return sp810->timerclken[clkspec->args[0]].clk; return sp810->timerclken[clkspec->args[0]].clk;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册