public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] hvsi: Keep index within state_names[]
@ 2009-07-12 23:41 Roel Kluin
  2009-07-13 11:39 ` Roel Kluin
  0 siblings, 1 reply; 2+ messages in thread
From: Roel Kluin @ 2009-07-12 23:41 UTC (permalink / raw)
  To: Andrew Morton, LKML

Keep index within state_names[]

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
diff --git a/drivers/char/hvsi.c b/drivers/char/hvsi.c
index 2989056..05dd854 100644
--- a/drivers/char/hvsi.c
+++ b/drivers/char/hvsi.c
@@ -196,7 +196,7 @@ static inline void print_state(struct hvsi_struct *hp)
 	};
 	const char *name = state_names[hp->state];
 
-	if (hp->state > ARRAY_SIZE(state_names))
+	if (hp->state >= ARRAY_SIZE(state_names))
 		name = "UNKNOWN";
 
 	pr_debug("hvsi%i: state = %s\n", hp->index, name);

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-07-13 11:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-12 23:41 [PATCH] hvsi: Keep index within state_names[] Roel Kluin
2009-07-13 11:39 ` Roel Kluin

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