[PATCH] hvsi: Keep index within state_names[]

From: Roel Kluin
Date: Sun Jul 12 2009 - 19:39:44 EST


Keep index within state_names[]

Signed-off-by: Roel Kluin <roel.kluin@xxxxxxxxx>
---
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);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/