Skip to content

Commit bea0b66

Browse files
HBh25Ybebarino
authored andcommitted
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: b14cbdf ("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>
1 parent 639d566 commit bea0b66

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/clk/ux500/reset-prcc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ static void __iomem *u8500_prcc_reset_base(struct u8500_prcc_reset *ur,
5858
prcc_num = id / PRCC_PERIPHS_PER_CLUSTER;
5959
index = prcc_num_to_index(prcc_num);
6060

61-
if (index > ARRAY_SIZE(ur->base))
61+
if (index >= ARRAY_SIZE(ur->base))
6262
return NULL;
6363

6464
return ur->base[index];

0 commit comments

Comments
 (0)