From: Manfred Spraul Use kmem_bufctl_t instead of int for the loop counters in check_slabp. Signed-of-by: Manfred Spraul Signed-off-by: Andrew Morton --- 25-akpm/mm/slab.c | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff -puN mm/slab.c~slab-64bit-fix mm/slab.c --- 25/mm/slab.c~slab-64bit-fix 2005-03-13 13:07:52.000000000 -0800 +++ 25-akpm/mm/slab.c 2005-03-13 13:07:52.000000000 -0800 @@ -1966,18 +1966,17 @@ static void *cache_free_debugcheck (kmem static void check_slabp(kmem_cache_t *cachep, struct slab *slabp) { - int i; + kmem_bufctl_t i; int entries = 0; check_spinlock_acquired(cachep); /* Check slab's freelist to see if this obj is there. */ for (i = slabp->free; i != BUFCTL_END; i = slab_bufctl(slabp)[i]) { entries++; - if (entries > cachep->num || i < 0 || i >= cachep->num) + if (entries > cachep->num || i >= cachep->num) goto bad; } if (entries != cachep->num - slabp->inuse) { - int i; bad: printk(KERN_ERR "slab: Internal list corruption detected in cache '%s'(%d), slabp %p(%d). Hexdump:\n", cachep->name, cachep->num, slabp, slabp->inuse); _