public inbox for linux-sh@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] SUPERH:beyond ARRAY_SIZE of onchip_ops
@ 2009-05-21 18:25 Roel Kluin
  0 siblings, 0 replies; only message in thread
From: Roel Kluin @ 2009-05-21 18:25 UTC (permalink / raw)
  To: linux-sh

Do not go beyond ARRAY_SIZE of onchip_ops

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7722.c b/arch/sh/kernel/cpu/sh4a/clock-sh7722.c
index 0e174af..d4757ad 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7722.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7722.c
@@ -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];
 }
 


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2009-05-21 18:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-21 18:25 [PATCH] SUPERH:beyond ARRAY_SIZE of onchip_ops Roel Kluin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox