lkml.org 
[lkml]   [2009]   [Jul]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] hvsi: Keep index within state_names[]
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);

\
 
 \ /
  Last update: 2009-07-13 01:43    [W:0.214 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site