Explorar o código

sh: clkfwk: beyond ARRAY_SIZE of onchip_ops for sh7722.

Do not go beyond ARRAY_SIZE of onchip_ops

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Roel Kluin %!s(int64=16) %!d(string=hai) anos
pai
achega
7fc1e5c15f
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      arch/sh/kernel/cpu/sh4a/clock-sh7722.c

+ 1 - 1
arch/sh/kernel/cpu/sh4a/clock-sh7722.c

@@ -883,7 +883,7 @@ struct clk_ops *onchip_ops[] = {
 void __init
 void __init
 arch_init_clk_ops(struct clk_ops **ops, int type)
 arch_init_clk_ops(struct clk_ops **ops, int type)
 {
 {
-	BUG_ON(type < 0 || type > ARRAY_SIZE(onchip_ops));
+	BUG_ON(type < 0 || type >= ARRAY_SIZE(onchip_ops));
 	*ops = onchip_ops[type];
 	*ops = onchip_ops[type];
 }
 }