block: Avoid accessing past the end of the block_by_role array.
authorJoseph Huang <jdhuang@stanford.edu>
Wed, 5 May 2010 16:23:55 +0000 (09:23 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Wed, 5 May 2010 16:24:22 +0000 (09:24 -0700)
src/devices/block.c

index 452c4331ff41aaa16534bb998d1b490349bc4217..a3acec16066240cc098f0c31d5a5c53efb99116a 100644 (file)
@@ -166,7 +166,7 @@ block_print_stats (void)
 {
   int i;
 
-  for (i = 0; i < BLOCK_CNT; i++)
+  for (i = 0; i < BLOCK_ROLE_CNT; i++)
     {
       struct block *block = block_by_role[i];
       if (block != NULL)