diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2015-07-29 12:17:06 +0200 |
---|---|---|
committer | Stephen Boyd <sboyd@codeaurora.org> | 2015-07-29 20:25:23 +0200 |
commit | 3294bee87091be5f179474f6c39d1d87769635e2 (patch) | |
tree | 4d2cdb345ce30074c25a6cc0c1f6b019535e880d /drivers/clk/versatile | |
parent | clk: exynos4: Fix wrong clock for Exynos4x12 ADC (diff) | |
download | linux-3294bee87091be5f179474f6c39d1d87769635e2.tar.xz linux-3294bee87091be5f179474f6c39d1d87769635e2.zip |
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: 6e973d2c4385 ('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>
Diffstat (limited to 'drivers/clk/versatile')
-rw-r--r-- | drivers/clk/versatile/clk-sp810.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/clk/versatile/clk-sp810.c b/drivers/clk/versatile/clk-sp810.c index 64b0129a0216..7fbe4d4bf35e 100644 --- a/drivers/clk/versatile/clk-sp810.c +++ b/drivers/clk/versatile/clk-sp810.c @@ -129,8 +129,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; |