Skip to contentSkip to conversation

ia64: beyond ARRAY_SIZE of unw.hash

PATCH New Roel Kluin 1 participant 1 message Feb 22, 2009

lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/1 ia64: beyond ARRAY_SIZE of unw.hash

static struct {

... :114

        unsigned short hash[UNW_HASH_SIZE];

... :147
} unw = {

... :228

        .hash = { [0 ... UNW_HASH_SIZE - 1] = -1 },

...
};

This is a bug, isn't it? --------------------------->8-------------8<------------------------------ Do not go beyond ARRAY_SIZE of unw.hash

---

arch/ia64/kernel/unwind.c +1 -1
index 67810b7..b6c0e63 100644
@@ -2149,7 +2149,7 @@ unw_remove_unwind_table (void *handle)
 
 	/* next, remove hash table entries for this table */
 
-	for (index = 0; index <= UNW_HASH_SIZE; ++index) {
+	for (index = 0; index < UNW_HASH_SIZE; ++index) {
 		tmp = unw.cache + unw.hash[index];
 		if (unw.hash[index] >= UNW_CACHE_SIZE
 		    || tmp->ip < table->start || tmp->ip >= table->end)