summaryrefslogtreecommitdiff
path: root/drivers/clk
diff options
context:
space:
mode:
authorHangyu Hua <hbh25y@gmail.com>2022-05-18 14:25:37 +0800
committerStephen Boyd <sboyd@kernel.org>2022-05-18 13:34:03 -0700
commitbea0b66efa654aee810d0f1791e8f3264bbc2eb9 (patch)
treecba861b489ed5d037157c0a85d277b0a1d7519df /drivers/clk
parent639d5661cc808057854681685ecb596406dbacce (diff)
clk: ux500: fix a possible off-by-one in u8500_prcc_reset_base()
Off-by-one will happen when index == ARRAY_SIZE(ur->base). Fixes: b14cbdfd467d ("clk: ux500: Add driver for the reset portions of PRCC") Signed-off-by: Hangyu Hua <hbh25y@gmail.com> Link: https://lore.kernel.org/r/20220518062537.17933-1-hbh25y@gmail.com Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Diffstat (limited to 'drivers/clk')
-rw-r--r--drivers/clk/ux500/reset-prcc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/clk/ux500/reset-prcc.c b/drivers/clk/ux500/reset-prcc.c
index fcd5d042806a..f7e48941fbc7 100644
--- a/drivers/clk/ux500/reset-prcc.c
+++ b/drivers/clk/ux500/reset-prcc.c
@@ -58,7 +58,7 @@ static void __iomem *u8500_prcc_reset_base(struct u8500_prcc_reset *ur,
prcc_num = id / PRCC_PERIPHS_PER_CLUSTER;
index = prcc_num_to_index(prcc_num);
- if (index > ARRAY_SIZE(ur->base))
+ if (index >= ARRAY_SIZE(ur->base))
return NULL;
return ur->base[index];