mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 01:49:46 +00:00
clk: versatile: off by one in clk_sp810_timerclken_of_get()
commit3294bee870upstream. The ">" should be ">=" or we end up reading beyond the end of the array. Fixes:6e973d2c43('clk: vexpress: Add separate SP810 driver') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Pawel Moll <pawel.moll@arm.com> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
30840a6068
commit
77ec29edce
@@ -128,8 +128,8 @@ static struct clk *clk_sp810_timerclken_of_get(struct of_phandle_args *clkspec,
|
||||
{
|
||||
struct clk_sp810 *sp810 = data;
|
||||
|
||||
if (WARN_ON(clkspec->args_count != 1 || clkspec->args[0] >
|
||||
ARRAY_SIZE(sp810->timerclken)))
|
||||
if (WARN_ON(clkspec->args_count != 1 ||
|
||||
clkspec->args[0] >= ARRAY_SIZE(sp810->timerclken)))
|
||||
return NULL;
|
||||
|
||||
return sp810->timerclken[clkspec->args[0]].clk;
|
||||
|
||||
Reference in New Issue
Block a user