Skip to contentSkip to conversation

SUPERH:beyond ARRAY_SIZE of onchip_ops

PATCH New Roel Kluin 1 participant 1 message May 21, 2009 SuperH

lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/1 SUPERH:beyond ARRAY_SIZE of onchip_ops

Do not go beyond ARRAY_SIZE of onchip_ops

---

arch/sh/kernel/cpu/sh4a/clock-sh7722.c +1 -1
index 0e174af..d4757ad 100644
@@ -809,7 +809,7 @@ struct clk_ops *onchip_ops[] = {
 void __init
 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];
 }