]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - mm/slub.c
slub: Use the objsize from the kmem_cache_cpu structure
[linux-2.6-omap-h63xx.git] / mm / slub.c
index d7d0d866b6b2e4df8c40a6c866ddfff8cebfdcd7..b49570ca08b5de961332b466a9d2cfe959a84ecf 100644 (file)
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -852,7 +852,7 @@ static int alloc_debug_processing(struct kmem_cache *s, struct page *page,
        if (!check_slab(s, page))
                goto bad;
 
-       if (object && !on_freelist(s, page, object)) {
+       if (!on_freelist(s, page, object)) {
                object_err(s, page, object, "Object already allocated");
                goto bad;
        }
@@ -862,7 +862,7 @@ static int alloc_debug_processing(struct kmem_cache *s, struct page *page,
                goto bad;
        }
 
-       if (object && !check_object(s, page, object, 0))
+       if (!check_object(s, page, object, 0))
                goto bad;
 
        /* Success perform special debug activities for allocs */
@@ -1681,8 +1681,8 @@ static __always_inline void slab_free(struct kmem_cache *s,
        unsigned long flags;
 
        local_irq_save(flags);
-       debug_check_no_locks_freed(object, s->objsize);
        c = get_cpu_slab(s, smp_processor_id());
+       debug_check_no_locks_freed(object, c->objsize);
        if (likely(page == c->page && c->node >= 0)) {
                object[c->offset] = c->freelist;
                c->freelist = object;